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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...