<?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: What command to use to get the count without using transforming commands for the alert I created? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/What-command-to-use-to-get-the-count-without-using-transforming/m-p/325509#M5780</link>
    <description>&lt;P&gt;I think I got it. I removed the field name from the table. I added all the filed names that I needed to use them in the alert subject and it worked. Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 28 Feb 2018 18:59:07 GMT</pubDate>
    <dc:creator>kollachandra</dc:creator>
    <dc:date>2018-02-28T18:59:07Z</dc:date>
    <item>
      <title>What command to use to get the count without using transforming commands for the alert I created?</title>
      <link>https://community.splunk.com/t5/Alerting/What-command-to-use-to-get-the-count-without-using-transforming/m-p/325506#M5777</link>
      <description>&lt;P&gt;I have to create an alert based on the number of the events I need to define the criticality and include that in the subject of the alert. But, I am using eventstats command in my search. So, I am not able to use the fields in the alert subject or body. Please provide an alternative.&lt;/P&gt;

&lt;P&gt;Base query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | eval counter=case(
        (time_taken &amp;gt; 90000), "Count_90", 
    some switch cases
        (time_taken &amp;gt; 4000), "Count_4"
        ) 
    | eventstats count(eval(match(counter,"Count_90"))) as "Counter_90" count(eval(match(counter,"Count_60"))) as "Counter_60" count(eval(match(counter,"Count_30"))) as "Counter_30" count(eval(match(counter,"Count_20"))) as "Counter_20" count(eval(match(counter,"Count_15"))) as "Counter_15" count(eval(match(counter,"Count_10"))) as "Counter_10" count(eval(match(counter,"Count_4"))) as "Counter_4"
    | eval criticality = case(
        (Counter_90&amp;gt;5), "Critical-90s",
        Some switch cases
        (Counter_04&amp;gt;24), "Critical-4s",
        (Counter_4&amp;gt;11 AND Counter_4 &amp;lt;= 17), "Warning-4s"
        )
    | table criticality,Time,host,c_ip,cs_uri_stem,s_ip,s_port,sc_status,sc_substatus,time_taken
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Feb 2018 17:17:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/What-command-to-use-to-get-the-count-without-using-transforming/m-p/325506#M5777</guid>
      <dc:creator>kollachandra</dc:creator>
      <dc:date>2018-02-28T17:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: What command to use to get the count without using transforming commands for the alert I created?</title>
      <link>https://community.splunk.com/t5/Alerting/What-command-to-use-to-get-the-count-without-using-transforming/m-p/325507#M5778</link>
      <description>&lt;P&gt;Based on what Splunk version you're using, you should be able to use fields from your search results in your Email Subject (see this &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.2/Alert/EmailNotificationTokens"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.2/Alert/EmailNotificationTokens&lt;/A&gt; ). Since the criticality is a field in your search result, you should be able to include it using &lt;CODE&gt;$result.criticality$&lt;/CODE&gt;. Please note only the first value for the specified field name from the first search result row will be added. &lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 17:29:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/What-command-to-use-to-get-the-count-without-using-transforming/m-p/325507#M5778</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-02-28T17:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: What command to use to get the count without using transforming commands for the alert I created?</title>
      <link>https://community.splunk.com/t5/Alerting/What-command-to-use-to-get-the-count-without-using-transforming/m-p/325508#M5779</link>
      <description>&lt;P&gt;Our's is Splunk 7.0.2. I tried to add that way to the alert subject. But, no use. I am getting an null value. As I used eventstats is that the reason? Is there any other way to perform what I was doing using eventstats command?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 17:41:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/What-command-to-use-to-get-the-count-without-using-transforming/m-p/325508#M5779</guid>
      <dc:creator>kollachandra</dc:creator>
      <dc:date>2018-02-28T17:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: What command to use to get the count without using transforming commands for the alert I created?</title>
      <link>https://community.splunk.com/t5/Alerting/What-command-to-use-to-get-the-count-without-using-transforming/m-p/325509#M5780</link>
      <description>&lt;P&gt;I think I got it. I removed the field name from the table. I added all the filed names that I needed to use them in the alert subject and it worked. Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 18:59:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/What-command-to-use-to-get-the-count-without-using-transforming/m-p/325509#M5780</guid>
      <dc:creator>kollachandra</dc:creator>
      <dc:date>2018-02-28T18:59:07Z</dc:date>
    </item>
  </channel>
</rss>

