<?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: Timechart average in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/540989#M153133</link>
    <description>&lt;P&gt;Add the second aggregation to the timechart command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= ... |eval Amount=lost_packages |where 2500 &amp;gt; Amount and Amount &amp;gt; 50
|timechart span=24h count(Amount) avg(Amount) aligntime=@d&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will probably want to put the average on a separate Y axis to the count - so format the timechart as needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Feb 2021 10:47:05 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2021-02-23T10:47:05Z</dc:date>
    <item>
      <title>Timechart average</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/540984#M153129</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am pretty new to splunk and need help with a timechart.&lt;/P&gt;&lt;P&gt;I have a timechart, that shows the count of packagelosses &amp;gt;50 per day. Now I want to add an average line to the chart, that matches to the chosen space of time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= ... |eval Amount=lost_packages |where 2500 &amp;gt; Amount and Amount &amp;gt; 50
|timechart span=24h count(Amount) aligntime=@d&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can somebody tell me how i can calculate the average of Amount in the chosen space of time and how I can add the average to the timechart?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 10:25:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/540984#M153129</guid>
      <dc:creator>schufi01</dc:creator>
      <dc:date>2021-02-23T10:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart average</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/540989#M153133</link>
      <description>&lt;P&gt;Add the second aggregation to the timechart command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= ... |eval Amount=lost_packages |where 2500 &amp;gt; Amount and Amount &amp;gt; 50
|timechart span=24h count(Amount) avg(Amount) aligntime=@d&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will probably want to put the average on a separate Y axis to the count - so format the timechart as needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 10:47:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/540989#M153133</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-02-23T10:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart average</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/540992#M153135</link>
      <description>&lt;P&gt;I already tried this before. avg(Amount) gives different averages for every single day. My goal is to get one single average for the whole time span. E.g. last month, I had an average of 50 per day (It should just be a straight line).&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 10:56:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/540992#M153135</guid>
      <dc:creator>schufi01</dc:creator>
      <dc:date>2021-02-23T10:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart average</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/540995#M153137</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231793"&gt;@schufi01&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ah, I misunderstood. Then do this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= ... 
| eval Amount=lost_packages
| where 2500 &amp;gt; Amount and Amount &amp;gt; 50
| timechart span=24h count(Amount) as Count sum(Amount) as Total aligntime=@d
| eventstats sum(Count) as TotalCount sum(Total) as TotalAmount
| eval Average=TotalAmount/TotalCount
| fields - TotalCount TotalAmount&lt;/LI-CODE&gt;&lt;P&gt;This just calculates the TotalCount and TotalAmount for the period and calculates the average&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 11:36:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/540995#M153137</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-02-23T11:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart average</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/541001#M153140</link>
      <description>&lt;P&gt;It works now, thank you. However, I would like to change something to get better information. At the Moment I can see how many packages have been lost on average. Is it possible to show the average number of events with Packagelosses &amp;gt;50 in the selected time space?&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Monday: 3 Losses (with 51,53,55 Packages that have been lost)&lt;/P&gt;&lt;P&gt;Tuesday: 2 Losses(with 61,63,Packages that have been lost)&lt;/P&gt;&lt;P&gt;Wednesday: 4 Losses(with 51,53,55,57 Packages that have been lost)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the moment the average gives me 55.444&lt;/P&gt;&lt;P&gt;Is it possible, that the average gives me the average number of events per day, which would be 3?&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&amp;gt;(3+2+4)/3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 11:57:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/541001#M153140</guid>
      <dc:creator>schufi01</dc:creator>
      <dc:date>2021-02-23T11:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart average</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/541006#M153142</link>
      <description>&lt;P&gt;I guess the last eval line must be changed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should be something like |eval Average= TotalCount/Timespan. But how can I get this working?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 13:10:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/541006#M153142</guid>
      <dc:creator>schufi01</dc:creator>
      <dc:date>2021-02-23T13:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart average</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/541140#M153186</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231793"&gt;@schufi01&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To work out the number of days in your search window, this should do the trick&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| addinfo
| eval days=round((info_max_time-info_min_time)/86400)
| eval averagePerDay=TotalCount/days
| fields - days info_*&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 09:07:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/541140#M153186</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-02-24T09:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart average</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/541145#M153190</link>
      <description>&lt;P&gt;Thank you! It works perfectly &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 09:17:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-average/m-p/541145#M153190</guid>
      <dc:creator>schufi01</dc:creator>
      <dc:date>2021-02-24T09:17:46Z</dc:date>
    </item>
  </channel>
</rss>

