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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...