Splunk Search

How to determine if the log is missing

xsstest
Communicator

there are many hosts in an indexer. How do I check if the log is missing?

If a host does not have a log Within an hour, I think it's a log loss

If a host log is lost, I need to find it and remind me.

How does the SPL statement write?

Tags (1)
0 Karma
1 Solution

inventsekar
SplunkTrust
SplunkTrust

Hi..
You can create an Alert for this task... and you can add an email notification.
The search query -

index=IndexName host=hostname.com source=/app/Java/1hr.log

and save this as an alert, and add an action for "Send email"
alt text

View solution in original post

0 Karma

inventsekar
SplunkTrust
SplunkTrust

Hi..
You can create an Alert for this task... and you can add an email notification.
The search query -

index=IndexName host=hostname.com source=/app/Java/1hr.log

and save this as an alert, and add an action for "Send email"
alt text

0 Karma

xsstest
Communicator

Do I need to set up an alert for each host?

0 Karma

inventsekar
SplunkTrust
SplunkTrust
  1. no need to setup for each host. you can get a list of all hosts that are not connected/sent events for last 1hr, 24hrs, etc.
  2. do you want alerts depending on host or depending on host plus the exact logfile?

The following search will alert you if there are any hosts that haven't sent any data for more than one hour (3600 seconds)

compare last event's time to now

 |metadata type=hosts | eval since=now()-lastTime | search since>3600 |...

OR
 # compare indexer's time when last event came to now
|metadata type=hosts | eval since=now()-recentTime| search since>3600 |...

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...