Getting Data In

Send email when application server/network device is not pushing syslog to Splunk

satoshi86
Engager

Hi All,

Is there a way for Splunk to send out an email notification when Splunk is not receiving any syslog entries from an application server or a network device?

Thanks.

Tags (1)
0 Karma
1 Solution

lguinn2
Legend

Yes, although you need to define some criteria. For example -

Search for hosts that have sent syslog events in the past week, but have not sent syslog events in the past hour.

Here is a search that would work:

sourcetype=*syslog* earliest=-7d 
| fields host 
| eval hcount = if (_time>=relative_time(now(),"-1h"),1,0)
| stats sum(hcount) as hourlyCount count as weeklyCount by host
| where hourlyCount == 0

You could then schedule this to run every hour and alert if number of events is greater than zero.

View solution in original post

0 Karma

lguinn2
Legend

Yes, although you need to define some criteria. For example -

Search for hosts that have sent syslog events in the past week, but have not sent syslog events in the past hour.

Here is a search that would work:

sourcetype=*syslog* earliest=-7d 
| fields host 
| eval hcount = if (_time>=relative_time(now(),"-1h"),1,0)
| stats sum(hcount) as hourlyCount count as weeklyCount by host
| where hourlyCount == 0

You could then schedule this to run every hour and alert if number of events is greater than zero.

0 Karma

satoshi86
Engager

thanks again for your help Iguinn!!

0 Karma

lguinn2
Legend

Sorry, it's a typo. I've updated my original answer to fix it! Thanks for commenting and sorry about that.

0 Karma

satoshi86
Engager

Hi Iguinn,
I tried to run your command and it gives me the error:-

Error in 'eval' command: The arguments to the 'relative_time' function are invalid.

May I know how do i fix that?
I'm very sorry, I'm kinda weak in programming.

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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...