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
Ultra Champion

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
Ultra Champion

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
Ultra Champion
  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!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...