Splunk Search

indicate an average value on a chart

wwhitener
Communicator

Greetings,

I am putting together a dashboard and have a bar graph doing the total counts. Is there a way to do an overlay or a CSS layer or something that indicates the average value on the bar chart? My original thought was to do a single line across the chart where the average value is.

Any thoughts?

Edited: More information and explanation below.

1 Solution

Lionel
Splunk Employee
Splunk Employee

Hello,

You should be able to add a new field in your Search and use the avg_trans (numeric) function.
In our example, we have a chart with two calculations on dynamic and one static (e.g. the avg_trans (numeric)) and the search looks something like that:
| eval bytes = bytes / 50 | eval avg_trans = 95

As we are using Real Time Search, it does not displays it at Bar Chart but you should be able to change the format of your graph.

Thank you

Lionel

View solution in original post

0 Karma

wwhitener
Communicator

I'm kind of looking for something like this.

I have, in total 100 instances of X that appear. Because X is a string, I use the count function to get a total count--call it XCount.

When I click on the bar for "X" in the chart, I want to see a second table/chart/etc that shows the count for X (CountX), what the average value for CountX is, what the maximum value has been for CountX, and the minimum value for CountX.

Ideally, I'd like to put the line on the initial chart indicating the average value for CountX.

0 Karma

Lionel
Splunk Employee
Splunk Employee

Hello,

You should be able to add a new field in your Search and use the avg_trans (numeric) function.
In our example, we have a chart with two calculations on dynamic and one static (e.g. the avg_trans (numeric)) and the search looks something like that:
| eval bytes = bytes / 50 | eval avg_trans = 95

As we are using Real Time Search, it does not displays it at Bar Chart but you should be able to change the format of your graph.

Thank you

Lionel

0 Karma

wwhitener
Communicator

Thanks for pointing me in the right direction.

I ended up using streamstats to do the running average, minimum and maximum.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...