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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...