Alerting

Splunk alert if no events in source returned in X time

markgomez00
Explorer

Hi I was wondering if it is possible on splunk to search for a specific message on a source/log then alert if the last event received was more than 2 minute ago

my search string is:

  index=[index] host=[host] sourcetype=[sourcetype] "Keyword"

I'm searching for the word "Keyword" and i want to set an alert if the last result is more than 2 minutes ago

Thanks in advance

Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

How about narrowing your search to the last 2 minutes and setting an alert if there are no results?

---
If this reply helps you, Karma would be appreciated.
0 Karma

markgomez00
Explorer

Hi @richgalloway thanks for your response,

I tried narrowing it to 2 minutes by adding 'earliest=-2m latest=now()' to my search, i have set it to run every 1 minute and if the result is 0 the alert should trigger, but sometimes the alert is triggering even if the results is > 0, is this a problem on timing?

note: the keyword is generated every 1 minute

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