Splunk Search

Log file validation based on serverhost and source

ganeshkumarmoha
Explorer

Hi Team,
For a business requirement, I need to validate log file generated for last an hour with combination of host and source in below order:

Host Source
server001c\:...\logpath1.txt
server002c\:...\logpath2.txt
server003c\:...\logpath3.txt
server004c\:...\logpath4.txt
server005c\:...\logpath5.txt

 

I knew, inputlookup keyword is single column based; however, I need it two columns to check the log file. Can you please suggest what is the best to accomplish my requirement?

Thanks in advance!

Labels (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @ganeshkumarmoha 

I suppose that you need to check if you' received events from each host with that source, is it correct?

if this is your requirement and if the source column has a fixed part that you can use for checking (e.g. the file name without path), please tru something like this:

<your_search>
| rex field=source "\\(?<Source>logpath\d*.txt)$"
| rename host AS Host
| stats count BY host Source
| append [ | inputlookup your_lookup.csv | eval count=0 | fields Host Source count ]
| stats sum(count) AS total BY Host Source
| where total=0 

Ciao.

Giuseppe

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @ganeshkumarmoha 

I suppose that you need to check if you' received events from each host with that source, is it correct?

if this is your requirement and if the source column has a fixed part that you can use for checking (e.g. the file name without path), please tru something like this:

<your_search>
| rex field=source "\\(?<Source>logpath\d*.txt)$"
| rename host AS Host
| stats count BY host Source
| append [ | inputlookup your_lookup.csv | eval count=0 | fields Host Source count ]
| stats sum(count) AS total BY Host Source
| where total=0 

Ciao.

Giuseppe

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @ganeshkumarmoha ,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...