Splunk Search

Comparing average to one row

mstrozyk
Engager

Hi,

I'm looking for a way to take the average of a bunch of fields and compare one row to that average using a visualization. I was hoping there would be a way to table the data and then compare the two using a column chart. The problem I'm running into is that every field is weighted due to it's calculation - essentially person A might have an average time of 2 minutes but the average was calculated with 4 events where as person B might have an average of 4 minutes but it was calculated using 100 events.

At the core it's really just taking the average of all data and then pulling one row out and comparing the two.

Thanks for your help!

Tags (1)
0 Karma

poete
Builder

Hello,
without the specific details, it is difficult to elaborate. However, please find an example of dashbard below, based of random values.
Here, we display the values in the bar grah, and the average as a line, over the values.

I hope this helps!

<dashboard>
  <row>
    <panel>
      <chart>
        <search>
          <query>|makeresults count=20
| eval val=random() % 55
| eventstats avg(val) as average
| chart avg(val) as value,avg(average) as averrage by val</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="charting.axisY2.enabled">0</option>
        <option name="charting.axisY2.scale">linear</option>
        <option name="charting.chart">column</option>
        <option name="charting.chart.overlayFields">averrage</option>
        <option name="charting.chart.stackMode">default</option>
        <option name="charting.drilldown">none</option>
        <option name="charting.layout.splitSeries">0</option>
        <option name="charting.layout.splitSeries.allowIndependentYRanges">1</option>
        <option name="refresh.display">progressbar</option>
      </chart>
    </panel>
  </row>
</dashboard>
0 Karma

cpetterborg
SplunkTrust
SplunkTrust

If you can provide a little bit of a sample of the data, that would be helpful in coming up with a respectable answer to your question.

0 Karma
Get Updates on the Splunk Community!

The OpenTelemetry Certified Associate (OTCA) Exam

What’s this OTCA exam? The Linux Foundation offers the OpenTelemetry Certified Associate (OTCA) credential to ...

From Manual to Agentic: Level Up Your SOC at Cisco Live

Welcome to the Era of the Agentic SOC   Are you tired of being a manual alert responder? The security ...

Splunk Classroom Chronicles: Training Tales and Testimonials (Episode 4)

Welcome back to Splunk Classroom Chronicles, our ongoing series where we shine a light on what really happens ...