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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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