Splunk Search

サーチ履歴を取得する方法は?

Splunk_Shinobi
Splunk Employee
Splunk Employee

サーチキーワードの履歴をリストして、
監査やナレッジ共有等に利用したいのですが履歴を取得することはできますか?

Tags (1)
0 Karma
1 Solution

melonman
Motivator

もし自分のユーザ上での履歴を取りたい場合には、

| history

全ユーザを対象としての履歴を取りたい場合には、

index=_audit action="search" search=* user!=splunk-system-user | table user search

などとしていただければ可能です。
ただし、searchフィールドにsearch=と指定されているキーサードが有ると、
そのままでは表示がうまくされないので、フィールド名の変更を行った上で、サーチ履歴をリストするとよいかもしれません。

以下のようにすると、サーチ履歴を集計することもできます。

index=_audit action="search" search=* user!=splunk-system-user | rex field=search max_match=1000 "|[ ]*(?\w+)" | stats count by term

term count

1 bin 127
2 bucket 204
3 convert 15
4 dbinfo 2
5 dbquery 13
6 dedup 142
7 delete 1

View solution in original post

piebob
Splunk Employee
Splunk Employee

historyコマンドは、検索履歴を示し
http://docs.splunk.com/Documentation/Splunk/5.0.2/SearchReference/History

ごめんなさい、私の日本語は下手です!

🙂

melonman
Motivator

もし自分のユーザ上での履歴を取りたい場合には、

| history

全ユーザを対象としての履歴を取りたい場合には、

index=_audit action="search" search=* user!=splunk-system-user | table user search

などとしていただければ可能です。
ただし、searchフィールドにsearch=と指定されているキーサードが有ると、
そのままでは表示がうまくされないので、フィールド名の変更を行った上で、サーチ履歴をリストするとよいかもしれません。

以下のようにすると、サーチ履歴を集計することもできます。

index=_audit action="search" search=* user!=splunk-system-user | rex field=search max_match=1000 "|[ ]*(?\w+)" | stats count by term

term count

1 bin 127
2 bucket 204
3 convert 15
4 dbinfo 2
5 dbquery 13
6 dedup 142
7 delete 1

Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...