<?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 achieve overlay graf with daily total, average per day for a week and standard deviation? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-overlay-graf-with-daily-total-average-per-day-for/m-p/642279#M222488</link>
    <description>&lt;P&gt;I'm trying to use tstats to calculate the daily total number of events for an index per day for one week. Then calculate an averade per day for the entire week, as well as upper and lower bounds +/- 1 standard deviation.&lt;/P&gt;
&lt;P&gt;Feels like I can get each individual thing to work, either the bar chart with the daily count, OR the statistics. Though I want them all in a single figure.&lt;/P&gt;
&lt;P&gt;This is my base search:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| tstats count as daily_events where index="index" earliest=-7d latest=-1d by _time span=1d 
# | timechart span=1d sum(daily_events) as daily_events&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which seems to work just fine by itself, with or without a following "timechart"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I figure I'd do something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| stats sum(daily_events) as total_events stdev(daily_events) as std_dev 
| eval avg_events=round(total_events/7, 0)
| eval upper = total_events + std_dev 
| eval lower = total_events - std_dev&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Which by itself seems to work, though I now loose the results from the base search.&lt;/P&gt;
&lt;P&gt;So how can I combine these things (can I combine?) into something close to what I want to achieve? I'm attaching a crude scetch for clarity.&lt;/P&gt;
&lt;P&gt;It feels like I somehow need to add three columns just replicating the upper, lower and av_events values for every "daily_events" entry, or something. I just can figure it out. Any feedback is mych appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 04 May 2023 13:22:06 GMT</pubDate>
    <dc:creator>fatsug</dc:creator>
    <dc:date>2023-05-04T13:22:06Z</dc:date>
    <item>
      <title>How to achieve overlay graf with daily total, average per day for a week and standard deviation?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-overlay-graf-with-daily-total-average-per-day-for/m-p/642279#M222488</link>
      <description>&lt;P&gt;I'm trying to use tstats to calculate the daily total number of events for an index per day for one week. Then calculate an averade per day for the entire week, as well as upper and lower bounds +/- 1 standard deviation.&lt;/P&gt;
&lt;P&gt;Feels like I can get each individual thing to work, either the bar chart with the daily count, OR the statistics. Though I want them all in a single figure.&lt;/P&gt;
&lt;P&gt;This is my base search:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| tstats count as daily_events where index="index" earliest=-7d latest=-1d by _time span=1d 
# | timechart span=1d sum(daily_events) as daily_events&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which seems to work just fine by itself, with or without a following "timechart"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I figure I'd do something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| stats sum(daily_events) as total_events stdev(daily_events) as std_dev 
| eval avg_events=round(total_events/7, 0)
| eval upper = total_events + std_dev 
| eval lower = total_events - std_dev&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Which by itself seems to work, though I now loose the results from the base search.&lt;/P&gt;
&lt;P&gt;So how can I combine these things (can I combine?) into something close to what I want to achieve? I'm attaching a crude scetch for clarity.&lt;/P&gt;
&lt;P&gt;It feels like I somehow need to add three columns just replicating the upper, lower and av_events values for every "daily_events" entry, or something. I just can figure it out. Any feedback is mych appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 13:22:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-overlay-graf-with-daily-total-average-per-day-for/m-p/642279#M222488</guid>
      <dc:creator>fatsug</dc:creator>
      <dc:date>2023-05-04T13:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to achieve overlay graf with daily total, average per day for a week and standard deviation?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-overlay-graf-with-daily-total-average-per-day-for/m-p/642370#M222520</link>
      <description>&lt;P&gt;You must be looking for &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eventstats" target="_blank" rel="noopener"&gt;eventstats&lt;/A&gt; (in lieu of stats)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats count as daily_events where index="index" earliest=-7d latest=-1d by _time span=1d
| eventstats sum(daily_events) as total_events stdev(daily_events) as std_dev
| eval avg_events=round(total_events/7, 0)
| eval upper = total_events + std_dev 
| eval lower = total_events - std_dev&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 08:47:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-overlay-graf-with-daily-total-average-per-day-for/m-p/642370#M222520</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-05-05T08:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to achieve overlay graf with daily total, average per day for a week and standard deviation?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-overlay-graf-with-daily-total-average-per-day-for/m-p/642373#M222523</link>
      <description>&lt;P&gt;I was just about to post myself but glad you beat me to the punch, totally forgot about aventstats!&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 08:49:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-overlay-graf-with-daily-total-average-per-day-for/m-p/642373#M222523</guid>
      <dc:creator>fatsug</dc:creator>
      <dc:date>2023-05-05T08:49:47Z</dc:date>
    </item>
  </channel>
</rss>

