Splunk Search

Why history command only shows my searches, not searches run by all users?

ashari
Explorer

I want to see all the searches that are run on Splunk server in a given time by different users. I am using the “|History” command which shows all the splunk searches that I have run but it does not show the searches run by other users.
Can you please help me to sort that out.

Thanks

Tags (2)
0 Karma
1 Solution

MuS
SplunkTrust
SplunkTrust

Hi ashari,

the history command can only be used to view the current user's search history.
If you need to see all searches done by all users, you need an account that can read index=_audit and search something like this:

 index=_audit action=search info=granted search=* NOT "search_id='scheduler" NOT "search='|history" NOT "user=splunk-system-user" NOT "search='typeahead" NOT "search='| metadata type=* | search totalCount>0" | stats count by user search _time | sort _time | convert ctime(_time) | stats list(_time) as time list(search) as search by user

hope this helps ...

cheers, MuS

View solution in original post

MuS
SplunkTrust
SplunkTrust

Hi ashari,

the history command can only be used to view the current user's search history.
If you need to see all searches done by all users, you need an account that can read index=_audit and search something like this:

 index=_audit action=search info=granted search=* NOT "search_id='scheduler" NOT "search='|history" NOT "user=splunk-system-user" NOT "search='typeahead" NOT "search='| metadata type=* | search totalCount>0" | stats count by user search _time | sort _time | convert ctime(_time) | stats list(_time) as time list(search) as search by user

hope this helps ...

cheers, MuS

ashari
Explorer

Thanks, it works fine.

phudinhha
Explorer

Hi MuS,

Do we need to specify the username to search for this?

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 ...