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!

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...