<?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 edit my search to add subtotals for successful events by _time for every error? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-subtotals-for-successful-events-by/m-p/267477#M80475</link>
    <description>&lt;P&gt;What I have:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Time                   User        count     Error
2016-02-04 04:18:00 cinci     1  
2016-02-04 04:18:01 cfl
                       tampabay    2     
2016-02-04 04:18:03 nc        4  
2016-02-04 04:18:04             1         1 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I need:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Time                   User        count      Error
2016-02-04 04:18:00 cinci     1  
2016-02-04 04:18:01 cfl
                       tampabay    2     
2016-02-04 04:18:03 nc        4  
Total users                        7
2016-02-04 04:18:04             1          1
Time                   User        count      Error
2016-02-04 04:18:08 cinci     2
2016-02-04 04:18:10 cfl
                       tampabay    2     
2016-02-04 04:18:13 nc        4  
Total users                        8
....
...
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;..... so before every error, it has to give the total successful event counts based on user and timestamp.&lt;/P&gt;

&lt;P&gt;My search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=prod user=* 
| fields user,_time
| stats count by user,_time 
| stats values(user) as Domain,sum(count) as Total by _time
| append [ search index=prod error="xyz"
| stats count by error,_time
| stats count(error) as Error,sum(count) as Total by _time]
| sort _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 04 Feb 2016 17:10:29 GMT</pubDate>
    <dc:creator>shivarpith</dc:creator>
    <dc:date>2016-02-04T17:10:29Z</dc:date>
    <item>
      <title>How to edit my search to add subtotals for successful events by _time for every error?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-subtotals-for-successful-events-by/m-p/267477#M80475</link>
      <description>&lt;P&gt;What I have:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Time                   User        count     Error
2016-02-04 04:18:00 cinci     1  
2016-02-04 04:18:01 cfl
                       tampabay    2     
2016-02-04 04:18:03 nc        4  
2016-02-04 04:18:04             1         1 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I need:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Time                   User        count      Error
2016-02-04 04:18:00 cinci     1  
2016-02-04 04:18:01 cfl
                       tampabay    2     
2016-02-04 04:18:03 nc        4  
Total users                        7
2016-02-04 04:18:04             1          1
Time                   User        count      Error
2016-02-04 04:18:08 cinci     2
2016-02-04 04:18:10 cfl
                       tampabay    2     
2016-02-04 04:18:13 nc        4  
Total users                        8
....
...
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;..... so before every error, it has to give the total successful event counts based on user and timestamp.&lt;/P&gt;

&lt;P&gt;My search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=prod user=* 
| fields user,_time
| stats count by user,_time 
| stats values(user) as Domain,sum(count) as Total by _time
| append [ search index=prod error="xyz"
| stats count by error,_time
| stats count(error) as Error,sum(count) as Total by _time]
| sort _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Feb 2016 17:10:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-subtotals-for-successful-events-by/m-p/267477#M80475</guid>
      <dc:creator>shivarpith</dc:creator>
      <dc:date>2016-02-04T17:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to add subtotals for successful events by _time for every error?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-subtotals-for-successful-events-by/m-p/267478#M80476</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=prod user=* 
 | fields user,_time
 | stats count by user,_time 
 | stats values(user) as Domain,sum(count) as Total by _time
 | append [ search index=prod error="xyz"
 | stats count by error,_time
 | stats count(error) as Error,sum(count) as Total by _time]
 | sort _time
 | eval temp=Error | fillnull temp value=0
 | accum temp | appendpipe [| stats max(_time) as _time sum(Total) as Total by  temp | eval Domain="***************Total Users"]
 | sort _time temp | fields - temp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Feb 2016 18:23:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-subtotals-for-successful-events-by/m-p/267478#M80476</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-04T18:23:07Z</dc:date>
    </item>
  </channel>
</rss>

