Splunk Search

Finding events for users that have not been seen in the last X days

Liran
Observer

I need to create a baseline for what is common in an environment before creating a rule.

The rule can be as simple as:

 

search index=x sourcetype=y NOT [search index=x sourcetype=y earliest=-14d  |  table user]

 

The issue is doing an historical search using a simple search. I've looked a few commands including transaction and streamstats but did not manage to find a way to run this search recursively. 

The basic idea is to find a rare value on a specific field that is only seen less than a set threshold (e.g. 10 events) during a 14 days windows.

Labels (1)
Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Liran ,

please trey something like this:

index=x sourcetype=y
| eval period=if(_time>now()-864000,"last","previous")
| stats count BY period
| search period="last" count<10

in this way you tag the  events in two categories: "last" (Last 10 days) and "previous".

Then you have events if in the last period there are less than a threshold (10 events).

ciao.

Giuseppe

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Not sure what the question is here - please can you clarify / expand?

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