Alerting

Splunk Alert if host on lookup stops sending data

scout29
Path Finder

Looking to create an alert if a host on a lookup stops sending data to Splunk index=abc. I have created a lookup called hosts.csv with all the hosts expected to be logging for a data source. Now i need to create a search/alert that notifies me if a host on this lookup stops sending data to index=abc

I was trying something like this  search below, but now having much luck:

| tstats count where index=abc host NOT [| inputlookup hosts.csv] by host

 

The lookup called hosts.csv is formatted with the column name being host, for example like:

 

host

hostname101

hostname102

hostname103

hostname104

 

Labels (3)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @scout29 ,

please try something like this:

| tstats count where index=abc BY host 
| append [ | inputlookup hosts.csv | eval count=0 | fields host count]
| stats sum(count) AS total BY host
| where total=0

Ciao.

Giuseppe

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @scout29 ,

please try something like this:

| tstats count where index=abc BY host 
| append [ | inputlookup hosts.csv | eval count=0 | fields host count]
| stats sum(count) AS total BY host
| where total=0

Ciao.

Giuseppe

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @scout29 

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

0 Karma
Get Updates on the Splunk Community!

Splunk and Fraud

Watch Now!Watch an insightful webinar where we delve into the innovative approaches to solving fraud using the ...

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...