<?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: count between events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/count-between-events/m-p/210241#M61488</link>
    <description>&lt;P&gt;Great, Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 31 Aug 2015 16:28:28 GMT</pubDate>
    <dc:creator>mkrauss1</dc:creator>
    <dc:date>2015-08-31T16:28:28Z</dc:date>
    <item>
      <title>count between events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-between-events/m-p/210237#M61484</link>
      <description>&lt;P&gt;I would like to count values between an event and i'm not getting an entry point for this at all.&lt;/P&gt;

&lt;P&gt;Assume i get an event like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SOURCE=ABC EVENT=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and from there i would like to count all results given in RESULT:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SOURCE=ABC RESULT=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;until the event goes off&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SOURCE=ABC EVENT=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Idealy this would work with multiple sources like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; SOURCE=ABC EVENT=1
 SOURCE=DEF EVENT=1
 SOURCE=ABC RESULT=1
 SOURCE=ABC EVENT=0
 SOURCE=DEF RESULT=2
 SOURCE=DEF EVENT=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then return something like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; RESULT_TOTAL=3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any ideas how to achieve this?&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 15:07:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-between-events/m-p/210237#M61484</guid>
      <dc:creator>mkrauss1</dc:creator>
      <dc:date>2015-08-31T15:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: count between events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-between-events/m-p/210238#M61485</link>
      <description>&lt;P&gt;May be something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search   | stats values(EVENT) as EVENT sum(RESULT) as RESULT by SOURCE 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you don't want to count the RESULT if there is no EVENT=0 after that, then just add this in the end of the above search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;....| where mvcount(EVENT)=2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Aug 2015 15:13:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-between-events/m-p/210238#M61485</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-31T15:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: count between events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-between-events/m-p/210239#M61486</link>
      <description>&lt;P&gt;Thanks for this. The sample looks stateless and counts any RESULT as long as EVENT is appearing. Is it possible to set a trigger? Say the count applies only after&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SOURCE=ABC EVENT=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;until&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SOURCE=ABC EVENT=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and ignore (don't) count anything else?&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 15:54:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-between-events/m-p/210239#M61486</guid>
      <dc:creator>mkrauss1</dc:creator>
      <dc:date>2015-08-31T15:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: count between events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-between-events/m-p/210240#M61487</link>
      <description>&lt;P&gt;How about this&lt;/P&gt;

&lt;P&gt;your base search   | stats list(EVENT) as EVENT sum(RESULT) as RESULT by SOURCE | where mvindex(EVENT,0)=0 AND mvindex(EVENT,1)=1&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 16:00:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-between-events/m-p/210240#M61487</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-31T16:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: count between events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-between-events/m-p/210241#M61488</link>
      <description>&lt;P&gt;Great, Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 16:28:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-between-events/m-p/210241#M61488</guid>
      <dc:creator>mkrauss1</dc:creator>
      <dc:date>2015-08-31T16:28:28Z</dc:date>
    </item>
  </channel>
</rss>

