Splunk Search

how do i get a list of all searches performed in splunk?

ytl
Path Finder

can someone help me with a query to provide me a table of _time, user, search string of all queries performed in splunk please?

Tags (2)
1 Solution

MuS
Legend

Hi ytl,

you need to have read access to index=_audit and run 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

if this does not match your needs, adapt this search.

Hope this helps ...

cheers, MuS

View solution in original post

MuS
Legend

Hi ytl,

you need to have read access to index=_audit and run 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

if this does not match your needs, adapt this search.

Hope this helps ...

cheers, MuS

MuS
Legend

as addition:

If you're on Splunk 6.x you can open this URL and get the same:

http[s]://YourSplunkServerName:YourSplunkWebPort/app/search/status_index

nawazns5038
Builder

how to exclude the searches obtained from a dashboard ?

0 Karma

niketn
Legend

@nawazns5038, if your intent is to find only the searches which are run through Splunk UI, you can try the following:

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=sourcetypes | search totalCount > 0"
| stats count by _time user search savedsearch_name  
| where savedsearch_name=""
| fields - savedsearch_name

PS: savedsearch_name will be given to saved searches and dashboard searches not for the searches run via UI.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...