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!

Splunk MCP & Agentic AI: Machine Data Without Limits

  Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization ...

Finding Based Detections General Availability

Overview  We’ve come a long way, folks, but here in Enterprise Security 8.4 I’m happy to announce Finding ...

Get Your Hands Dirty (and Your Shoes Comfy): The Splunk Experience

Hands-On Learning and Technical Seminars  Sometimes, you just need to see the code. For those looking for a ...