<?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: Creating an alert with field value count within a transaction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Creating-an-alert-with-field-value-count-within-a-transaction/m-p/416838#M119941</link>
    <description>&lt;P&gt;DO NOT user &lt;CODE&gt;transaction&lt;/CODE&gt;; try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="myindex" AND (EventCode=1 OR EventCode=2) earliest=-5m
| eventstats count(eval(EventCode=1)) AS loginFail count(eval(EventCode=2)) AS loginSuccess BY user
| where loginFail &amp;gt;= 10 AND loginSuccess &amp;gt; 0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 29 Jul 2019 18:26:26 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-07-29T18:26:26Z</dc:date>
    <item>
      <title>Creating an alert with field value count within a transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-an-alert-with-field-value-count-within-a-transaction/m-p/416837#M119940</link>
      <description>&lt;P&gt;I am trying to create an alert for the below search that would go off if within the event there are 10 times where EventCode equals 1 within a 5-minute span. I also want EventCode equals 2 once within that span which is why I am doing the search for EventID equals 1 AND EventID equals 2.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="myindex" EventCode=1 OR EventCode=2   earliest=-5m
| transaction user   | search EventID=1 AND EventID=2  
| eventstats 
                count(eval(match(EventID,"1"))) as loginFail
                count(eval(match(EventID,"2"))) as loginSuccess
                by user
|table user,loginFail,loginSuccess
|where loginFail &amp;gt;= 10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Currently the results of this search are:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;user                          loginFail            loginSuccess
testuser                          1                      1
exampleuser                       1                      1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Even if there are 3 times within the transaction where EventID equals 1 and 1 time where it equals 2.&lt;/P&gt;

&lt;P&gt;Thanks for any help! &lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 18:15:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-an-alert-with-field-value-count-within-a-transaction/m-p/416837#M119940</guid>
      <dc:creator>mcg_connor</dc:creator>
      <dc:date>2019-07-29T18:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an alert with field value count within a transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-an-alert-with-field-value-count-within-a-transaction/m-p/416838#M119941</link>
      <description>&lt;P&gt;DO NOT user &lt;CODE&gt;transaction&lt;/CODE&gt;; try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="myindex" AND (EventCode=1 OR EventCode=2) earliest=-5m
| eventstats count(eval(EventCode=1)) AS loginFail count(eval(EventCode=2)) AS loginSuccess BY user
| where loginFail &amp;gt;= 10 AND loginSuccess &amp;gt; 0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jul 2019 18:26:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-an-alert-with-field-value-count-within-a-transaction/m-p/416838#M119941</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-29T18:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an alert with field value count within a transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-an-alert-with-field-value-count-within-a-transaction/m-p/416839#M119942</link>
      <description>&lt;P&gt;Awesome thanks for the helpful answer!&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 18:32:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-an-alert-with-field-value-count-within-a-transaction/m-p/416839#M119942</guid>
      <dc:creator>mcg_connor</dc:creator>
      <dc:date>2019-07-29T18:32:14Z</dc:date>
    </item>
  </channel>
</rss>

