Alerting

Alert On Non Update Of A File

itsomana
Path Finder

I have a linux file that I would like Splunk to index. There will be a Saved Search configured for this file on a dashboard as a traffic light. If in the event the file is not update after 10 minutes the traffic will go from green to red.

What is be best way to configure this

Tags (1)
0 Karma
1 Solution

lguinn2
Legend
| metadata type=sources | search source=yoursourcefilename | eval checkTime = relative_time(now(), "-10m") | 
fields + source recentTime checkTime | eval LastEventReceived = strftime(recentTime, "%F %r") |
eval TenMinutesAgo = strftime(checkTime, "%F %r")

Save this as an alert (in 4.3, choose "Create Alert"). In your custom search condition, put

where checkTime > recentTime

The search computes checkTime as the epoch time as of 10 minutes ago. The metadata command returns recentTime as the most recent time that an event was indexed from the source. And yes, there is no search here - the first character is really a |

Alternately, you could use lastTime instead of recentTime. See more about this choice in the Search Reference manual entry for the metadata command.

View solution in original post

lguinn2
Legend
| metadata type=sources | search source=yoursourcefilename | eval checkTime = relative_time(now(), "-10m") | 
fields + source recentTime checkTime | eval LastEventReceived = strftime(recentTime, "%F %r") |
eval TenMinutesAgo = strftime(checkTime, "%F %r")

Save this as an alert (in 4.3, choose "Create Alert"). In your custom search condition, put

where checkTime > recentTime

The search computes checkTime as the epoch time as of 10 minutes ago. The metadata command returns recentTime as the most recent time that an event was indexed from the source. And yes, there is no search here - the first character is really a |

Alternately, you could use lastTime instead of recentTime. See more about this choice in the Search Reference manual entry for the metadata command.

lguinn2
Legend

Maybe, but you need to decide
(1) What value, exactly, do you want to display on the dashboard?
(2) What visualization do you want to use? A single value panel?
(3) Do you want the dashboard to auto-refresh? How often?
After you decide these things, you will probably have some significant XML to write...

itsomana
Path Finder

Do you know is possible to put the above saved search onto a dashboard and if 10 minutes elapses then it will go from green to red?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...