Other Usage

Anomalous event detection by date/time

BradOH
Path Finder

Hey, something we haven't dug into seriously yet are the anomaly detection functions of Splunk.  Specifically, we're looking to develop a search that flags out of bounds events for further analysis.

Example, user generally accesses 9 to 5 everyday, then randomly accesses at 11pm one evening, report this. Is there a way to do this with the built in functions and not require an external tool or AI/ML model?

If you could even point me to some resources with examples, that'd be great.  Thanks!

Labels (2)
0 Karma

shashankD
Explorer

You can read/create dashboard using _audit logs, where all this info can be seen, else you can use the below query index=your_index sourcetype=your_sourcetype | eval hour=strftime(_time,"%H") | stats count by user hour | eventstats avg(count) as avg stdev(count) as std by user | eval zscore=(count-avg)/std | where abs(zscore)>2 OR hour<9 OR hour>17

0 Karma

BradOH
Path Finder

Thanks, I had reviewed the examples in the Splunk documentation, but your example gave me a better idea how use the anomalydetection function in context.

0 Karma

PrewinThomas
Motivator

@BradOH 

You can use functions like anomalydetection, outlier or build a baseline of normal hours and compare against current events.


Below example shows anomaly values based on hour

index=your_index sourcetype=your_sourcetype user=*
| eval hour=strftime(_time,"%H")
| stats count by user, hour
| anomalydetection method=histogram action=filter

Refer below for the usage of anomalydetection
#https://help.splunk.com/en/splunk-enterprise/spl-search-reference/10.0/search-commands/anomalydetect...


Regards,
Prewin
🌟If this answer helped you, please consider marking it as the solution or giving a Karma. Thanks!

Get Updates on the Splunk Community!

Your Guide to Splunk Digital Experience Monitoring

A flawless digital experience isn't just an advantage, it's key to customer loyalty and business success. But ...

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...