<?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: How do you create an alert which compares two different query counts? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-do-you-create-an-alert-which-compares-two-different-query/m-p/456752#M8106</link>
    <description>&lt;P&gt;It is the case when it made it as a search sentence as it is.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(1st Query )
| stats count as count_1
| appendcols 
    [search (2st Query )
| stats count as count_2]
| where count_1!=count_2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 13 Sep 2018 02:07:08 GMT</pubDate>
    <dc:creator>HiroshiSatoh</dc:creator>
    <dc:date>2018-09-13T02:07:08Z</dc:date>
    <item>
      <title>How do you create an alert which compares two different query counts?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-you-create-an-alert-which-compares-two-different-query/m-p/456751#M8105</link>
      <description>&lt;P&gt;I have two querys :-&lt;/P&gt;

&lt;P&gt;1st Query (this query gives me the total number of counts which match with log "data * is successfully created")  :-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc  "Data * is successfully created"  | stats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2nd Query (this query gives me total message posted to kafka):- &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="abc" ("Data * is successfully posted to kafka topic") | rex "random=(?.*)}]" |  eval nowstring=strftime(now(), "%Y-%m-%d") | stats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I want to create an alert based on 1st and 2nd query count:&lt;BR /&gt;
 &lt;STRONG&gt;E.g. if 1st query count != 2nd query count, trigger an alert.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Could you please help me to create this query ?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 21:38:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-you-create-an-alert-which-compares-two-different-query/m-p/456751#M8105</guid>
      <dc:creator>amarpravin</dc:creator>
      <dc:date>2018-09-12T21:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create an alert which compares two different query counts?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-you-create-an-alert-which-compares-two-different-query/m-p/456752#M8106</link>
      <description>&lt;P&gt;It is the case when it made it as a search sentence as it is.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(1st Query )
| stats count as count_1
| appendcols 
    [search (2st Query )
| stats count as count_2]
| where count_1!=count_2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Sep 2018 02:07:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-you-create-an-alert-which-compares-two-different-query/m-p/456752#M8106</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2018-09-13T02:07:08Z</dc:date>
    </item>
  </channel>
</rss>

