Monitoring Splunk

What are the fields in _audit that specify the interval for each search?

danielbb
Motivator

We would like to produce statistics about the usage of Splunk and we would like to categorize the searches by ranges, whether they cover the last day, past week or past month, and I wonder which fields in _audit provide the beginning and end interval of the search.  

Labels (1)
Tags (1)
0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @danielbb 

You could start with something like this:

index=_audit action=search info=completed search_et!="N/A" 
| eval time_span=search_lt-search_et
| eval time_span_group=case(
    time_span<3600, "<1hr",
    time_span>=3600 AND time_span<7200, "1-2hrs",
    time_span>=7200 AND time_span<43200, "<12hrs",
    time_span>=43200 AND time_span<86400, "<24hrs",
    time_span>=86400 AND time_span<259200, "<3days",
    time_span>=259200 AND time_span<604800, "<7days",
    time_span>=604800 AND time_span<2592000, "<30days",
    time_span>=2592000 AND time_span<7776000, "<90days",
    time_span>=7776000 AND time_span<31536000, "<1year",
    time_span>=31536000, "more"
)
| stats count by time_span_group

livehybrid_0-1750953124820.png

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

danielbb
Motivator

Amazing! thank you.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Check out the search_et and search_lt fields.

---
If this reply helps you, Karma would be appreciated.
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, ...