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!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...