Splunk Search

Splunk Search to identify users searching back 30 days or more

scout29
Path Finder

I am trying to create a search that shows me all users that are searching back 30 days or longer in Splunk.

For example, if user123 ran a search of "index = windows" and selected a time picker value of 30 days, i would want the search results to show me the username, the search used, and the time picker used. 

I would want to see this for any users searching back 30 days or more in splunk.

This is what i have started with to use as a base search, but i am not finding any fields that show a time picker value:

index=_audit  action="search" 

Labels (5)
0 Karma

scout29
Path Finder

I am trying to get a list of splunk users and searches that are searching back 30 DAYS or longer. 

livehybrid
SplunkTrust
SplunkTrust

Sorry, I was giving an example as I didnt have any users searching over 30 days.

Please see below, I have added a table command too.

index=_audit action="search" info=completed
| eval et=COALESCE(search_et, api_et), lt=COALESCE(search_lt, api_lt)
| eval timespanSecs=lt-et
| where timespanSecs>(60*60*24*30)
| eval friendlyTime=tostring(timespanSecs, "duration")
| table user search friendlyTime

Is this what you are after?

Please let me know how you get on and consider accepting this answer or adding karma this answer if it has helped.
Regards

Will

livehybrid
SplunkTrust
SplunkTrust

Hi @scout29 

Try the following query, this takes the earliest time from the latest time to give the number of seconds searches across, then filter where >1800 (30 mins)

index=_audit action="search" info=completed
| eval et=COALESCE(search_et, api_et), lt=COALESCE(search_lt, api_lt)
| eval timespanSecs=lt-et
| where timespanSecs>1800

Please let me know how you get on and consider accepting this answer or adding karma this answer if it has helped.
Regards

Will

0 Karma

scout29
Path Finder

This is not what i am looking for -  i am trying to get a list of splunk users and searches that are searching back 30 DAYS or longer. 

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...