Monitoring Splunk

Does Splunk log the SEARCH MODE (Verbose, Fast...) for each user's search.

splunkclarium
New Member

I would like to determine the search mode (Verbose, Fast...) for each user's search.

I am currently using this search from GoSplunk.c0m but I am having difficulty locating the search mode.

Can anyone assist?

index=_audit action=search sourcetype=audittrail search_id=* NOT (user=splunk-system-user) search!="'typeahead*"
| rex "search\=\'(search|\s+)\s(?P[\n\S\s]+?(?=\'))"
| rex field=search "sourcetype\s*=\s*\"*(?[^\s\"]+)" 
| rex field=search "index\s*=\s*\"*(?[^\s\"]+)"
| stats latest(_time) as Latest by user search SourcetypeUsed IndexUsed
| convert ctime(Latest)
0 Karma
1 Solution

MuS
SplunkTrust
SplunkTrust

Hi splunkclarium,

I usually use something like this to get the search.mode :

index=_internal sourcetype=splunkd_ui_access q!="" 
| rex field=uri_query "display\.page\.search\.mode=(?<search_mode>[^\&]+)" 
| table _time host user q search_mode 
| eval q=urldecode(q)

Hope this helps ...

cheers, MuS

View solution in original post

amounika
New Member

The accepted query is not working all the time. In certain internal logs for few user searches we doesn't have "q" field in the logs and search mode field is also not defined.

By using restAPI we are able to check the saved search result and user activity but it is server specific.

Could you provide a way to track each user's search and the mode of search(In particular Verbose) and the query ran for a particular peroid for a clustered envirnoment.

0 Karma

MuS
SplunkTrust
SplunkTrust

Hi splunkclarium,

I usually use something like this to get the search.mode :

index=_internal sourcetype=splunkd_ui_access q!="" 
| rex field=uri_query "display\.page\.search\.mode=(?<search_mode>[^\&]+)" 
| table _time host user q search_mode 
| eval q=urldecode(q)

Hope this helps ...

cheers, MuS

splunkclarium
New Member

It did. THanks!!

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...