Alerting

Alert if text is not present

peter_gianusso
Communicator

I want to alert if the text "OmniKrnlService.main: starting, service name" is not present in a log file by 8:30 AM every day.

I know how to alert when text is present but not how to alert when it's not present.

Tags (2)
0 Karma
1 Solution

gkanapathy
Splunk Employee
Splunk Employee

Seems fairly straightforward. You search for the text in the file over the appropriate time range (e.g., midnight to 8:30am, run at 8:45am). Then send an alert if the count of results is zero, or less than 1. That is an option available when configuring alerts.

View solution in original post

0 Karma

ArthurGautesen
Path Finder

index=WhatYouChoose "OmniKrnlService.main" earliest=-0d@d latest=-0d@d+510m | stats count | eval Flag=if(count>0,1,0) | search Flag=1

This would have you searching between midnight and 8:30am each day, but there isn't a solid way to decimal point it

(510 minutes from midnight is 8:30am)

| search Flag=1 would mean you found results
| search Flag=0 would mean you did not find results

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

Seems fairly straightforward. You search for the text in the file over the appropriate time range (e.g., midnight to 8:30am, run at 8:45am). Then send an alert if the count of results is zero, or less than 1. That is an option available when configuring alerts.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...