<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to compare all time average of a field value vs average for specified time range in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-all-time-average-of-a-field-value-vs-average-for/m-p/338609#M100407</link>
    <description>&lt;P&gt;Trying to combine in a single table the all time average of a field value (data feed start is 10/19) vs its average from a time picked range:&lt;/P&gt;

&lt;P&gt;search foo earliest=10/19/2017:0:0:0 &lt;BR /&gt;
| stats avg(rpm_average) as ALLTIME_AVG by interfaces &lt;BR /&gt;
| eval ALLTIME_AVG=ALLTIME_AVG/1000 &lt;BR /&gt;
| eval ALLTIME_AVG=round(ALLTIME_AVG,2) &lt;BR /&gt;
| append &lt;BR /&gt;
    [ search foo&lt;BR /&gt;
    | stats avg(rpm_average) as TIMEPICKED_AVG by interfaces &lt;BR /&gt;
    | eval TIMEPICKED_AVG=TIMEPICKED_AVG/1000&lt;BR /&gt;
    | eval TIMEPICKED_AVG=round(TIMEPICKED_AVG,2)] &lt;BR /&gt;
| table interfaces ALLTIME_AVG TIMEPICKED_AVG&lt;/P&gt;

&lt;P&gt;I am getting the below result but would like to combine rows (tried to MVDEDUP interfaces but did not work). Also, would like to add another column for difference.&lt;/P&gt;

&lt;P&gt;Thank you in advance!&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/219634-sample.jpg" alt="![alt text][1]" /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 16:31:21 GMT</pubDate>
    <dc:creator>christopheryu</dc:creator>
    <dc:date>2020-09-29T16:31:21Z</dc:date>
    <item>
      <title>How to compare all time average of a field value vs average for specified time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-all-time-average-of-a-field-value-vs-average-for/m-p/338609#M100407</link>
      <description>&lt;P&gt;Trying to combine in a single table the all time average of a field value (data feed start is 10/19) vs its average from a time picked range:&lt;/P&gt;

&lt;P&gt;search foo earliest=10/19/2017:0:0:0 &lt;BR /&gt;
| stats avg(rpm_average) as ALLTIME_AVG by interfaces &lt;BR /&gt;
| eval ALLTIME_AVG=ALLTIME_AVG/1000 &lt;BR /&gt;
| eval ALLTIME_AVG=round(ALLTIME_AVG,2) &lt;BR /&gt;
| append &lt;BR /&gt;
    [ search foo&lt;BR /&gt;
    | stats avg(rpm_average) as TIMEPICKED_AVG by interfaces &lt;BR /&gt;
    | eval TIMEPICKED_AVG=TIMEPICKED_AVG/1000&lt;BR /&gt;
    | eval TIMEPICKED_AVG=round(TIMEPICKED_AVG,2)] &lt;BR /&gt;
| table interfaces ALLTIME_AVG TIMEPICKED_AVG&lt;/P&gt;

&lt;P&gt;I am getting the below result but would like to combine rows (tried to MVDEDUP interfaces but did not work). Also, would like to add another column for difference.&lt;/P&gt;

&lt;P&gt;Thank you in advance!&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/219634-sample.jpg" alt="![alt text][1]" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:31:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-all-time-average-of-a-field-value-vs-average-for/m-p/338609#M100407</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2020-09-29T16:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare all time average of a field value vs average for specified time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-all-time-average-of-a-field-value-vs-average-for/m-p/338610#M100408</link>
      <description>&lt;P&gt;Do it at the same time.  Much more efficient.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; my search
| eval period_average =case(  test that  _time is in the period you want, rpm_average) 
| stats avg(rpm_average) as ALLTIME_AVG, avg(period_average) as TIMEPICKED_AVG by interfaces
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;FYI, If there were a reason not to do the above, you could just do this at the end...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(*) as * by interfaces
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Oct 2017 22:25:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-all-time-average-of-a-field-value-vs-average-for/m-p/338610#M100408</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-30T22:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare all time average of a field value vs average for specified time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-all-time-average-of-a-field-value-vs-average-for/m-p/338611#M100409</link>
      <description>&lt;P&gt;Just add into your search.&lt;/P&gt;

&lt;P&gt;YOUR_SEARCH | stats values(ALLTIME_AVG ) as ALLTIME_AVG  values(TIMEPICKED_AVG) as TIMEPICKED_AVG by interfaces&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:27:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-all-time-average-of-a-field-value-vs-average-for/m-p/338611#M100409</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-09-29T16:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare all time average of a field value vs average for specified time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-all-time-average-of-a-field-value-vs-average-for/m-p/338612#M100410</link>
      <description>&lt;P&gt;thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 15:48:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-all-time-average-of-a-field-value-vs-average-for/m-p/338612#M100410</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2017-11-02T15:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare all time average of a field value vs average for specified time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-all-time-average-of-a-field-value-vs-average-for/m-p/338613#M100411</link>
      <description>&lt;P&gt;2nd one worked, pretty much the same as kamlesh's. Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 15:48:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-all-time-average-of-a-field-value-vs-average-for/m-p/338613#M100411</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2017-11-02T15:48:11Z</dc:date>
    </item>
  </channel>
</rss>

