Splunk Search

Merging Splunk Searches

memow8
New Member

Hi Pros,

I want to merge results of two queries together and need some help in achieving the best possible way to do it...

index=* sourcetype=* | top sourcetype limit=200
index=* sourcetype=* | stats count(host) by sourcetype

I want to show.... following results...

Sourcetype Hosts(number of hosts contributing to the sourcetype) Count(Event count) Percentage (based on time)

Tags (1)
0 Karma

renjith_nair
Legend

Hi @memow8,

Try this

index="your index"|stats count(host) as no_of_hosts by sourcetype|eventstats sum(no_of_hosts) as total|eval perc=round((no_of_hosts/total)*100,2)|sort -no_of_hosts
---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Get Updates on the Splunk Community!

Splunk and TLS: It doesn't have to be too hard

Overview Creating a TLS cert for Splunk usage is pretty much standard openssl.  To make life better, use an ...

Faster Insights with AI, Streamlined Cloud-Native Operations, and More New Lantern ...

Splunk Lantern is a Splunk customer success center that provides practical guidance from Splunk experts on key ...

Splunk Enterprise Security: Your Command Center for PCI DSS Compliance

Every security professional knows the drill. The PCI DSS audit is approaching, and suddenly everyone's asking ...