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!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

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 ...