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!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...