Splunk Search

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

gsawyer1
Engager

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

martin_mueller
SplunkTrust
SplunkTrust

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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...