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!

Stay Connected: Your Guide to January Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...

[Puzzles] Solve, Learn, Repeat: Reprocessing XML into Fixed-Length Events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...