Splunk Search

How to create a stacked column chart with count(_time) split by index (_internal, main) for each host?


I don't understand why this should be so difficult....okay, here is my search:

host=* index=_internal OR index=main | stats count(_time) by host index

This does generate the data I want - for each host, there is a count of number of events in each of the two indexes. I want to split the bar graph by index, and display the count(_time) in each index for each host.

So host x should display one bar, split as two colors - one for each index - and each color indicating the number of events in that index. And all of the hosts should comprise the x-axis. So that way I can compare the ratio of fill of each index, for each host.
I can't find any examples of stacked charts online that help me much. Liked I said, seems like this should be easy....

0 Karma


It is easy if you use chart instead stats:

index=_internal OR index=main | chart count over host by index

The key difference is that this turns one set of field values into columns instead of rows.

0 Karma
Get Updates on the Splunk Community!

What's New in Splunk Cloud Platform 9.2.2403?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.2.2403! Analysts can ...

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

Dive into our sizzling summer lineup for July and August Community Office Hours and Tech Talks. Scroll down to ...

Edge Processor Scaling, Energy & Manufacturing Use Cases, and More New Articles on ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...