<?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 Re: How to get an average from this search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402410#M116454</link>
    <description>&lt;P&gt;Thanks harshpatel!&lt;BR /&gt;
I think I have it working now!!&lt;BR /&gt;
Thanks Everyone&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jun 2019 19:49:57 GMT</pubDate>
    <dc:creator>kvanwagoner</dc:creator>
    <dc:date>2019-06-03T19:49:57Z</dc:date>
    <item>
      <title>How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402393#M116437</link>
      <description>&lt;P&gt;I'm using the following search which I have working in a dashboard.&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;"A PUT was made to OpenAAA API - Status: OK"&lt;/EM&gt; &lt;BR /&gt;
&lt;CODE&gt;| spath AppID | search AppID=200296 Environment=prod | timechart count by Environment|&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;It displays the # of events for each day without issue.&lt;BR /&gt;&lt;BR /&gt;
But how can I get the average # of events for the same 7-day time frame?&lt;/P&gt;

&lt;P&gt;Any help would be greatly appreciated! &lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 14:10:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402393#M116437</guid>
      <dc:creator>kvanwagoner</dc:creator>
      <dc:date>2019-06-03T14:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402394#M116438</link>
      <description>&lt;P&gt;Hello there, have you try&lt;BR /&gt;
    ... | timechart avg(count) as avgCount by Environment span=1d&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 15:19:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402394#M116438</guid>
      <dc:creator>alemarzu</dc:creator>
      <dc:date>2019-06-03T15:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402395#M116439</link>
      <description>&lt;P&gt;Hi @kvanwagoner,&lt;/P&gt;

&lt;P&gt;You can provide span value in the &lt;CODE&gt;timechart&lt;/CODE&gt; command to have it display count over 7 day period.&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"A PUT was made to OpenAAA API - Status: OK" | spath AppID | search AppID=200296 Environment=prod | timechart span=7d count by Environment
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Splunk Doc: &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/Timechart#Bin_options"&gt;Timechart Bin Options&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 15:30:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402395#M116439</guid>
      <dc:creator>harshpatel</dc:creator>
      <dc:date>2019-06-03T15:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402396#M116440</link>
      <description>&lt;P&gt;Thank you @alemarzu &lt;BR /&gt;
I just tried "A PUT was made to OpenAAA API - Status: OK" | spath AppID | search AppID=200296 Environment=prod |timechart avg(count) as avgCount by Environment span=1d&lt;/P&gt;

&lt;P&gt;and got No Results found&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 15:35:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402396#M116440</guid>
      <dc:creator>kvanwagoner</dc:creator>
      <dc:date>2019-06-03T15:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402397#M116441</link>
      <description>&lt;P&gt;Thanks @harshpatel&lt;BR /&gt;
I tried that and it returned the following&lt;/P&gt;

&lt;P&gt;_time                 prod&lt;BR /&gt;
2019-05-27       2353&lt;BR /&gt;
2019-06-03       79&lt;/P&gt;

&lt;P&gt;Not quite what I'm looking for.  I need the average over the 7 days which should be around 347.&lt;BR /&gt;
I'm not sure what the 2353 actually represents.&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;BR /&gt;
Thanks&lt;/P&gt;

&lt;P&gt;This is what was returned from my original search&lt;BR /&gt;
27th 44&lt;BR /&gt;
28th 390&lt;BR /&gt;
29th 586&lt;BR /&gt;
30th 520&lt;BR /&gt;
31st 492&lt;BR /&gt;
1st    211&lt;BR /&gt;
2nd  110&lt;BR /&gt;
3rd   83 &lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 15:39:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402397#M116441</guid>
      <dc:creator>kvanwagoner</dc:creator>
      <dc:date>2019-06-03T15:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402398#M116442</link>
      <description>&lt;P&gt;Hi @kvanwagoner , Can you try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"A PUT was made to OpenAAA API - Status: OK" | spath AppID | search AppID=200296 Environment=prod | timechart count by Environment | bin span=7d _time | stats avg(prod) by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Jun 2019 15:55:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402398#M116442</guid>
      <dc:creator>harshpatel</dc:creator>
      <dc:date>2019-06-03T15:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402399#M116443</link>
      <description>&lt;P&gt;You have just one Environment i.e. Production right? Use the below query -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; "A PUT was made to OpenAAA API - Status: OK" | spath AppID | search AppID=200296 Environment=prod | timechart span=1d count by Environment| eventstats sum(Production) as sum| eval  average=Production/sum
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Jun 2019 15:56:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402399#M116443</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-06-03T15:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402400#M116444</link>
      <description>&lt;P&gt;Thanks @harshpatel &lt;BR /&gt;
That returns 2 records when using "Last 7 days" in search&lt;BR /&gt;
2019-05-27 334&lt;BR /&gt;
2019-06-03 146&lt;/P&gt;

&lt;P&gt;This is closer to what I need but I'm not sure why it's returning 2 records and the average is slightly off&lt;BR /&gt;
355 should be the last 7 day average based on the results from my original search&lt;BR /&gt;
I just need it to give me 1...any ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 17:48:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402400#M116444</guid>
      <dc:creator>kvanwagoner</dc:creator>
      <dc:date>2019-06-03T17:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402401#M116445</link>
      <description>&lt;P&gt;In what timerange you are running this query? If you just want last 7 days records you run your search for last 7 days only. Your records are of more than 7 days. That's why it is getting an extra row.&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 18:15:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402401#M116445</guid>
      <dc:creator>harshpatel</dc:creator>
      <dc:date>2019-06-03T18:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402402#M116446</link>
      <description>&lt;P&gt;Hi @kvanwagoner,&lt;/P&gt;

&lt;P&gt;If this is what you are looking for!! This search gives the &lt;STRONG&gt;average of events count per day&lt;/STRONG&gt;. Run this search in last 7 day. &lt;CODE&gt;&amp;lt;your search&amp;gt; | timechart count span=1d | stats avg(count) as avg_count&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 18:16:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402402#M116446</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2019-06-03T18:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402403#M116447</link>
      <description>&lt;P&gt;@harshpatel &lt;BR /&gt;
I used the search criteria you gave me with a timerange of Last 7 Days.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 18:24:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402403#M116447</guid>
      <dc:creator>kvanwagoner</dc:creator>
      <dc:date>2019-06-03T18:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402404#M116448</link>
      <description>&lt;P&gt;Thanks @VatsalJagani &lt;BR /&gt;
I used the following with a "last 7 days" search &lt;/P&gt;

&lt;P&gt;"A PUT was made to OpenAAA API - Status: OK" | spath AppID | search AppID=200296 Environment=prod | timechart count span=1d | stats avg(count) as avg_count&lt;/P&gt;

&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 18:33:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402404#M116448</guid>
      <dc:creator>kvanwagoner</dc:creator>
      <dc:date>2019-06-03T18:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402405#M116449</link>
      <description>&lt;P&gt;Well if you just want average then you can do something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"A PUT was made to OpenAAA API - Status: OK" | spath AppID | search AppID=200296 Environment=prod | timechart count by Environment | bin span=7d _time | stats avg(prod)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Jun 2019 18:35:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402405#M116449</guid>
      <dc:creator>harshpatel</dc:creator>
      <dc:date>2019-06-03T18:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402406#M116450</link>
      <description>&lt;P&gt;That returns a single record! &lt;BR /&gt;
But the average is still off at least by my count.&lt;/P&gt;

&lt;P&gt;24+390+586+520+492+211+110+184 = 2517&lt;BR /&gt;
2517/7 = 359&lt;/P&gt;

&lt;P&gt;But the query is returning 314.  So weird&lt;/P&gt;

&lt;P&gt;Any ideas @harshpatel ?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 19:06:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402406#M116450</guid>
      <dc:creator>kvanwagoner</dc:creator>
      <dc:date>2019-06-03T19:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402407#M116451</link>
      <description>&lt;P&gt;@kvanwagoner did you try above search. Please replace Production by prod in above query as your environment name is prod. &lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 19:14:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402407#M116451</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-06-03T19:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402408#M116452</link>
      <description>&lt;P&gt;Yes, I tried that one and changed the fields to Prod.  I appreciate the help but that didn't give me what I needed.  &lt;/P&gt;

&lt;P&gt;I;m looking for a singular average for the events over a 7 day period.  I think so of the other suggestions will work for me.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 19:25:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402408#M116452</guid>
      <dc:creator>kvanwagoner</dc:creator>
      <dc:date>2019-06-03T19:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402409#M116453</link>
      <description>&lt;P&gt;Splunk query actually divides it by 8 if you want to divide by 7 you can use: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"A PUT was made to OpenAAA API - Status: OK" | spath AppID | search AppID=200296 Environment=prod | timechart count by Environment | bin span=7d _time | stats sum(prod) as sum_prod | eval average_count=sum_prod/7
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Jun 2019 19:25:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402409#M116453</guid>
      <dc:creator>harshpatel</dc:creator>
      <dc:date>2019-06-03T19:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402410#M116454</link>
      <description>&lt;P&gt;Thanks harshpatel!&lt;BR /&gt;
I think I have it working now!!&lt;BR /&gt;
Thanks Everyone&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 19:49:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402410#M116454</guid>
      <dc:creator>kvanwagoner</dc:creator>
      <dc:date>2019-06-03T19:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402411#M116455</link>
      <description>&lt;P&gt;@kvanwagoner - If what you want is "average of events count per day" then query is correct.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 05:16:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402411#M116455</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2019-06-04T05:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to get an average from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402412#M116456</link>
      <description>&lt;P&gt;Thanks @VatsalJagani !&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 11:11:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-an-average-from-this-search/m-p/402412#M116456</guid>
      <dc:creator>kvanwagoner</dc:creator>
      <dc:date>2019-06-04T11:11:42Z</dc:date>
    </item>
  </channel>
</rss>

