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!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...