Getting Data In

get source files not updated in last 1 hour

nani2rahul
New Member

I want to get source files not updated in last 1 hour in specific host. Like in host java123 there are 2 logs /logs/abc.txt, /logs/def.txt. If they didn't update from past 1 hour i want an alert. how can i achive this.. I tried below one but it is showing all logs from all hosts.

| metadata index=* type=sources | eval age = now()- lastTime | where age > 3600

How to specify search for specific source files.

Tags (1)
0 Karma

sundareshr
Legend

Something like this should work `| where age>3600 AND match(source, "/logs/(abc|def).

You could also do something like this to limit to a specific host(s)

index=* host=abc source=*abc* OR source=*def* earliest=-1h@h | stats count by source | where count=0
0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...