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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...