<?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: need help with streamstats in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/need-help-with-streamstats/m-p/406232#M117429</link>
    <description>&lt;P&gt;@kiamco,&lt;BR /&gt;
Try this and lets know what modification you require.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=summary source="summary_events"  orig_source=some_source ms_region=us-west-1 ms_level=E*
|bucket span=5m _time|stats sum(count) by _time,event|eval date=strftime(_time,"%d-%m-%Y")
|streamstats dc(date) as dayno|eval dayno="Day".dayno|fields - date
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 12 Aug 2018 06:46:02 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2018-08-12T06:46:02Z</dc:date>
    <item>
      <title>need help with streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/need-help-with-streamstats/m-p/406231#M117428</link>
      <description>&lt;P&gt;I have this problem with streamstats maybe I am not understanding it right but my expected result didnt come out from the query that I wrote&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary source="summary_events" 
orig_source=some_source
ms_region=us-west-1
ms_level=E*
| stats sum(count) as totalEvents by _time event
| streamstats time_window=1d first(totalEvents) as day1 by event
| streamstats time_window=2d first(totalEvents) as day2 by event 
| streamstats time_window=3d first(totalEvents) as day3 by event
| streamstats time_window=4d first(totalEvents) as day4 by event
| streamstats time_window=5d first(totalEvents) as day5 by event
| streamstats time_window=6d first(totalEvents) as day6 by event
| streamstats time_window=7d first(totalEvents) as day7 by event
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The sample result is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time   event   totalEvents day1    day2    day3    day4    day5    day6    day7
2018-08-04 22:00:00 no-event    217 217 217 217 217 217 217 217
2018-08-04 22:00:00 service-error   1   1   1   1   1   1   1   1
2018-08-04 22:00:00 bad-url 7   7   7   7   7   7   7   7
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my expectation was that it is going to display the total count for each past day per 5min interval but I am just getting the same value for all of them.Any ideas what Im doing wrong? &lt;/P&gt;

&lt;P&gt;as sample event that I am aggregating is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;08/11/2018 22:15:00 +0000, search_name="Summary index: Error reports", search_now=1534026000.000, info_min_time=1534025400.000, info_max_time=1534026000.000, info_search_time=1534026007.707, count=3, event="some_event", ms_level=ERROR, ms_region="region", ms_version=version, orig_source="source"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Aug 2018 22:50:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/need-help-with-streamstats/m-p/406231#M117428</guid>
      <dc:creator>kiamco</dc:creator>
      <dc:date>2018-08-11T22:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: need help with streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/need-help-with-streamstats/m-p/406232#M117429</link>
      <description>&lt;P&gt;@kiamco,&lt;BR /&gt;
Try this and lets know what modification you require.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=summary source="summary_events"  orig_source=some_source ms_region=us-west-1 ms_level=E*
|bucket span=5m _time|stats sum(count) by _time,event|eval date=strftime(_time,"%d-%m-%Y")
|streamstats dc(date) as dayno|eval dayno="Day".dayno|fields - date
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 12 Aug 2018 06:46:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/need-help-with-streamstats/m-p/406232#M117429</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-08-12T06:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: need help with streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/need-help-with-streamstats/m-p/406233#M117430</link>
      <description>&lt;P&gt;@renjith.nair  so I tried the query above and this is what I got :&lt;BR /&gt;
sample result&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  _time event   sum(count)  dayno
    2018-08-05 23:00:00 idna-encode-failed  1   Day1
    2018-08-05 23:00:00 monitor-set-selection-error 4   Day1
    2018-08-05 23:00:00 no-event    53  Day1
    2018-08-05 23:00:00 srouter-browser-useragent-ie-valid-failed   8   Day1
    2018-08-05 23:00:00 tc-frame-load-timed-out 2   Day1
    2018-08-05 23:00:00 tc-pairing-unexpected-response  6   Day1
    2018-08-05 23:05:00 auth-password-reset-failed  1   Day1
    2018-08-05 23:05:00 no-event    60  Day1
    2018-08-05 23:05:00 srouter-bad-url 2   Day1
    2018-08-05 23:05:00 srouter-browser-useragent-ie-valid-failed   10  Day1
    2018-08-05 23:05:00 srouter-fetch-retry-failed  43  Day1
    2018-08-05 23:05:00 tc-cb-generated-exception   1   Day1
    2018-08-05 23:05:00 tc-pairing-unexpected-response  2   Day1
    2018-08-05 23:10:00 no-event    77  Day1
    2018-08-05 23:10:00 service-unavailable-error   1   Day1
    2018-08-05 23:10:00 srouter-bad-url 2   Day1
    2018-08-05 23:10:00 srouter-browser-useragent-ie-valid-failed   8   Day1
    2018-08-05 23:10:00 srouter-fetch-retry-failed  28  Day1
    2018-08-05 23:10:00 surrogate-unknown-fid   4   Day1
    2018-08-05 23:10:00 tc-pairing-unexpected-response  10  Day1
    2018-08-05 23:15:00 monitor-set-selection-error 1   Day1
    2018-08-05 23:15:00 no-event    58  Day1
    2018-08-05 23:15:00 srouter-browser-useragent-ie-valid-failed   6   Day1
    2018-08-05 23:15:00 srouter-fetch-retry-failed  1   Day1
    2018-08-05 23:15:00 srouter-popup-pair-failure  1   Day1
    2018-08-05 23:15:00 surrogate-unknown-fid   1   Day1
    2018-08-05 23:15:00 tc-pairing-unexpected-response  7   Day1
    2018-08-05 23:15:00 tc-uncaught-exception   1   Day1
    2018-08-05 23:20:00 channel-xhr-push-lost-message   3   Day1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it goes all the way to day 7&lt;/P&gt;

&lt;P&gt;which is giving me the information that I wanted but not in the format that I was looking for &lt;/P&gt;</description>
      <pubDate>Sun, 12 Aug 2018 23:49:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/need-help-with-streamstats/m-p/406233#M117430</guid>
      <dc:creator>kiamco</dc:creator>
      <dc:date>2018-08-12T23:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: need help with streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/need-help-with-streamstats/m-p/406234#M117431</link>
      <description>&lt;P&gt;Do you want to display all 5 minutes interval count as field name (that will be a long list) or just sum/day? &lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2018 03:31:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/need-help-with-streamstats/m-p/406234#M117431</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-08-13T03:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: need help with streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/need-help-with-streamstats/m-p/406235#M117432</link>
      <description>&lt;P&gt;@renjith.nair so what I wanted is for the column fields would be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; _time    event    totalEvents    day1    day2    day3    day4    day5    day6    day7
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There is a reason why I wanted it in this format, I was planning on running a foreach command and compare the past days by the total event and see whether or not it is an outlier stuff like that.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2018 16:57:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/need-help-with-streamstats/m-p/406235#M117432</guid>
      <dc:creator>kiamco</dc:creator>
      <dc:date>2018-08-13T16:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: need help with streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/need-help-with-streamstats/m-p/406236#M117433</link>
      <description>&lt;P&gt;@kiamco,&lt;BR /&gt;
Alright  try this,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index=summary source="summary_events"  orig_source=some_source ms_region=us-west-1 ms_level=E*
 |timechart span=5m sum(count)  as count by event|eval date=strftime(_time,"%d-%m-%Y"),time=strftime(_time,"%H:%M:%S")
|table time,event,count,date|eval temp=time."-".event
|chart values(count) over temp by date|rex field=temp "(?&amp;lt;time&amp;gt;[^-]+)-(?&amp;lt;event&amp;gt;[^-]+)"
|fields - temp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Aug 2018 15:26:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/need-help-with-streamstats/m-p/406236#M117433</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-08-14T15:26:26Z</dc:date>
    </item>
  </channel>
</rss>

