Splunk Search

List process count and 0 when didn't found

leonardomassard
Explorer

I'm tring to do a search for some process for a server but I would like for those that are not running the result comes with 0, becouse in splunk the process when not running they don't bring any information:

exemplo:
index=os sourcetype=ps host IN (wmwl5000 , wmwl5001, wmwl5002)
| search process="launch.sh" OR process="WebLogic.sh"
| stats count(process) by host

What I wish to see is like this:

wmwl5000 launch.sh 1
wmwl5000 weblogic.sh 0
wmwl5001 launch.sh 1
wmwl5001 weblogic.sh 1

Cheers

Tags (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@leonardomassardi

Have you tried this?

index=os sourcetype=ps host IN (wmwl5000 , wmwl5001, wmwl5002)
| search process="launch.sh" OR process="WebLogic.sh"
| stats count(process) by host,process 
0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...