<?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: Average count based on day in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Average-count-based-on-day/m-p/410061#M118285</link>
    <description>&lt;P&gt;I am looking for something similar. Buy my search is not giving proper c value. &lt;/P&gt;

&lt;P&gt;If I select seven days, then c value will be 1 (i.e. one week cannot have more than 1 Monday, 1 Tuesday....) If my duration is 2 weeks then C value should be 2. How to get proper c value. &lt;/P&gt;

&lt;P&gt;I am getting proper D value. PFB my search. &lt;/P&gt;

&lt;P&gt;index="apigee" sourcetype="apigee:hec" | search DeveloperAppName="someappname" | convert timeformat="%A" ctime(_time) AS date | eventstats count(date) as C | eventstats count as D by date| stats values(C) as C, values(D) as D by date| eval AVG= D/C * 100&lt;/P&gt;

&lt;P&gt;Your help is appreciated.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jan 2019 20:38:28 GMT</pubDate>
    <dc:creator>th1agarajan</dc:creator>
    <dc:date>2019-01-16T20:38:28Z</dc:date>
    <item>
      <title>Average count based on day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-count-based-on-day/m-p/410058#M118282</link>
      <description>&lt;P&gt;index="apigee" sourcetype="apigee:hec" | search DeveloperAppName="someappname" | convert timeformat="%A" ctime(_time) AS date | stats count by date | sort -count&lt;/P&gt;

&lt;P&gt;Tuesday 200&lt;BR /&gt;
Monday 190&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
Saturday 20&lt;BR /&gt;
Sunday 10&lt;/P&gt;

&lt;P&gt;Above search is giving count based on day. But I am looking for avg count based on day. I tried adding avg before count but i didn't get any results&lt;/P&gt;

&lt;P&gt;index="apigee" sourcetype="apigee:hec" | search DeveloperAppName="someappname" | convert timeformat="%A" ctime(_time) AS date | stats avg(count) by date | sort -count&lt;/P&gt;

&lt;P&gt;I am looking for something like this&lt;/P&gt;

&lt;P&gt;Tuesday 99%  (add count of all tuesdays and divide by number of tuesday)&lt;BR /&gt;
Monday  80%&lt;BR /&gt;
..&lt;BR /&gt;
...&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 18:51:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-count-based-on-day/m-p/410058#M118282</guid>
      <dc:creator>th1agarajan</dc:creator>
      <dc:date>2019-01-16T18:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Average count based on day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-count-based-on-day/m-p/410059#M118283</link>
      <description>&lt;P&gt;You would do something like below , please rename variables as per your need&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="wineventlog" | eventstats count as C| eventstats count as D by Date|stats values(C) as C, values(D) as D by Date| eval per= D/C * 100
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Jan 2019 19:06:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-count-based-on-day/m-p/410059#M118283</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-01-16T19:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Average count based on day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-count-based-on-day/m-p/410060#M118284</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="apigee" sourcetype="apigee:hec"  DeveloperAppName="someappname" 
| timechart span=1d count 
| convert timeformat="%A" ctime(_time) AS date | stats avg(count) as count by date | sort -count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Jan 2019 19:07:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-count-based-on-day/m-p/410060#M118284</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-01-16T19:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Average count based on day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-count-based-on-day/m-p/410061#M118285</link>
      <description>&lt;P&gt;I am looking for something similar. Buy my search is not giving proper c value. &lt;/P&gt;

&lt;P&gt;If I select seven days, then c value will be 1 (i.e. one week cannot have more than 1 Monday, 1 Tuesday....) If my duration is 2 weeks then C value should be 2. How to get proper c value. &lt;/P&gt;

&lt;P&gt;I am getting proper D value. PFB my search. &lt;/P&gt;

&lt;P&gt;index="apigee" sourcetype="apigee:hec" | search DeveloperAppName="someappname" | convert timeformat="%A" ctime(_time) AS date | eventstats count(date) as C | eventstats count as D by date| stats values(C) as C, values(D) as D by date| eval AVG= D/C * 100&lt;/P&gt;

&lt;P&gt;Your help is appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 20:38:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-count-based-on-day/m-p/410061#M118285</guid>
      <dc:creator>th1agarajan</dc:creator>
      <dc:date>2019-01-16T20:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Average count based on day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-count-based-on-day/m-p/410062#M118286</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="apigee" sourcetype="apigee:hec" | search DeveloperAppName="someappname" | convert timeformat="%A" ctime(_time) AS week | eval date=strftime(_time,"%Y/%m%d")|  stats dc(date) as C, count as D by week| eval AVG= D/C` 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Jan 2019 20:57:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-count-based-on-day/m-p/410062#M118286</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-01-16T20:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Average count based on day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-count-based-on-day/m-p/410063#M118287</link>
      <description>&lt;P&gt;This is what I was looking for. Thank you Vijeta. &lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 21:28:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-count-based-on-day/m-p/410063#M118287</guid>
      <dc:creator>th1agarajan</dc:creator>
      <dc:date>2019-01-16T21:28:37Z</dc:date>
    </item>
  </channel>
</rss>

