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!

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...