Splunk Search

Validating if 100 nodes are on boarded in splunk indexes or not. If not ?

jcorcoran508
Path Finder

I have this task were I am successful in getting result sets from nodes that are present in my splunk instance.

How ever I can't find a way to announce in the spl syntax if the Name of the Node that doesn't exist with a Yes or no value in another field

i.e.

Node            present

Appserver   No

 

 

Labels (1)
Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @jcorcoran508,

I think that Node is the hostname or a field of each system that's sending logs.

In this way you could create a lookup (called e.g. perimeter.csv) containing all the Nodes to monitor (at least one field called e.g. Node or host, in the following example Node), then you have to run a search like this:

index=your_index
| eval Node=lower(Node)
| stats count BY Node
| append [ | inputlookup perimeter.csv | eval Node=lower(Node), count=0, | fields Node count ]
| stats sum(count) AS total BY Node
| eval present=if(total=0,"No","Yes")
| table Node present

Ciao.

Giuseppe

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @jcorcoran508,

I think that Node is the hostname or a field of each system that's sending logs.

In this way you could create a lookup (called e.g. perimeter.csv) containing all the Nodes to monitor (at least one field called e.g. Node or host, in the following example Node), then you have to run a search like this:

index=your_index
| eval Node=lower(Node)
| stats count BY Node
| append [ | inputlookup perimeter.csv | eval Node=lower(Node), count=0, | fields Node count ]
| stats sum(count) AS total BY Node
| eval present=if(total=0,"No","Yes")
| table Node present

Ciao.

Giuseppe

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @jcorcoran508,

good for you, see next time!

Ciao and happy splunking.

Giuseppe

P.S.: Karma Points are appreciated 😉

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...