<?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: custom alert condtion  for  search query in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/custom-alert-condtion-for-search-query/m-p/36975#M412</link>
    <description>&lt;P&gt;In the original searches, you join the results of the second search to the first search using &lt;CODE&gt;allen_id&lt;/CODE&gt;. For the following join, you use &lt;CODE&gt;total_id&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;But I can't see how these joins could possibly work, as the second and third searches do not return fields named &lt;CODE&gt;allen_id&lt;/CODE&gt; or &lt;CODE&gt;total_id&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Also, your two subsearches are running over All Time - not just the search range that you chose for the outer search. Did you intend to do that?&lt;/P&gt;</description>
    <pubDate>Thu, 21 Feb 2013 04:04:12 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2013-02-21T04:04:12Z</dc:date>
    <item>
      <title>custom alert condtion  for  search query</title>
      <link>https://community.splunk.com/t5/Alerting/custom-alert-condtion-for-search-query/m-p/36972#M409</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;sourcetype="access_combined_wcookie" uri_path="/en/US/*" OR uri_path="/web/fw/*" OR uri_path="/assets/*" dc="ALLN"
| chart count(uri_path) as Allen_hits
| join allen_id  [ search 
   host="cdcxweb-prod*" sourcetype="access_combined_wcookie" uri_path="/en/US/*" OR uri_path="/web/fw/*" 
   OR uri_path="/assets/*" dc="RCDN"
   | chart count(uri_path) as Rcdn_hits ] 
| join total_id [ search 
   host="cdcxweb-prod*" sourcetype="access_combined_wcookie" uri_path="/en/US/*" OR uri_path="/web/fw/*" 
   OR uri_path="/assets/*" 
   | chart count(uri_path) as Total_hits ]
| eval AllenPercentage=(Allen_hits/Total_hits)*100 
| eval RcdnPercentage=(Rcdn_hits/Total_hits)*100
| eval SLA_STATUS=case(RcdnPercentage&amp;gt;80 AND AllenPercentage&amp;lt;20,1234)
| table Allen_hits Rcdn_hits Total_hits AllenPercentage RcdnPercentage SLA_STATUS
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have created custom alert condition as below, but still am not getting alert and email.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search SLA_STATUS = 1234
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;pls help me on this one.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2013 19:30:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/custom-alert-condtion-for-search-query/m-p/36972#M409</guid>
      <dc:creator>sarkanth12</dc:creator>
      <dc:date>2013-02-19T19:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: custom alert condtion  for  search query</title>
      <link>https://community.splunk.com/t5/Alerting/custom-alert-condtion-for-search-query/m-p/36973#M410</link>
      <description>&lt;P&gt;First - do the individual searches (run separately) return any results?&lt;BR /&gt;&lt;BR /&gt;
Second - does the entire search return an &lt;CODE&gt;SLA_STATUS=1234&lt;/CODE&gt;?&lt;BR /&gt;
Third - what if you leave off the word &lt;CODE&gt;search&lt;/CODE&gt; in the custom alert condition?&lt;/P&gt;

&lt;P&gt;Finally, I think you could write a search that would run &lt;EM&gt;much&lt;/EM&gt; faster:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="access_combined_wcookie" 
(uri_path="/en/US/*" OR uri_path="/web/fw/*" OR uri_path="/assets/*") 
(dc="ALLN" OR host="cdcxweb-prod*")
| eval series=case(dc=="ALLN","Allen",
                   dc=="RCDN" AND host="cdcxweb-prod*","Rcdn",
                   host=="cdcxweb-prod*","OTH_cdcxweb".
                   1==1,"Unknown")
| where series!="Unknown"
| chart count by series 
| eval totalHits = Rcdn + OTH_cdcxweb
| eval AllenPercentage=(Allen/totalHits)*100 
| eval RcdnPercentage=(Rcdn/totalHits)*100
| eval SLA_STATUS=if(RcdnPercentage&amp;gt;80 AND AllenPercentage&amp;lt;20,1234)
| table Allen Rcdn totalHits AllenPercentage RcdnPercentage SLA_STATUS
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Feb 2013 03:33:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/custom-alert-condtion-for-search-query/m-p/36973#M410</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-02-20T03:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: custom alert condtion  for  search query</title>
      <link>https://community.splunk.com/t5/Alerting/custom-alert-condtion-for-search-query/m-p/36974#M411</link>
      <description>&lt;P&gt;thanks for your help. I did individual searches and getting results as expected and also entire search return the o/p as follow.&lt;/P&gt;

&lt;P&gt;Allen_hits  Rcdn_hits   Total_hits  AllenPercentage RcdnPercentage  SLA_STATUS&lt;BR /&gt;
0   416326  473875  0   87.855658   1234&lt;/P&gt;

&lt;P&gt;as  you suggested ,&lt;BR /&gt;
I ran the below  search query and getting  only Allen and Rcdn  vlaues and  not getting OTH_cdcxweb values&lt;BR /&gt;
sourcetype="access_combined_wcookie" &lt;BR /&gt;
(uri_path="/en/US/&lt;EM&gt;" OR uri_path="/web/fw/&lt;/EM&gt;" OR uri_path="/assets/&lt;EM&gt;") &lt;BR /&gt;
(dc="ALLN" OR host="cdcxweb-prod&lt;/EM&gt;")&lt;BR /&gt;
| eval series=case(dc=="ALLN","Allen",&lt;BR /&gt;
                   dc=="RCDN" AND host="cdcxweb-prod*","Rcdn",&lt;BR /&gt;
                   host=="cdcxweb-prod*","OTH_cdcxweb".&lt;BR /&gt;
                   1==1,"Unknown")&lt;BR /&gt;
| where series!="Unknown"&lt;BR /&gt;
| chart count by series &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:21:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/custom-alert-condtion-for-search-query/m-p/36974#M411</guid>
      <dc:creator>sarkanth12</dc:creator>
      <dc:date>2020-09-28T13:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: custom alert condtion  for  search query</title>
      <link>https://community.splunk.com/t5/Alerting/custom-alert-condtion-for-search-query/m-p/36975#M412</link>
      <description>&lt;P&gt;In the original searches, you join the results of the second search to the first search using &lt;CODE&gt;allen_id&lt;/CODE&gt;. For the following join, you use &lt;CODE&gt;total_id&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;But I can't see how these joins could possibly work, as the second and third searches do not return fields named &lt;CODE&gt;allen_id&lt;/CODE&gt; or &lt;CODE&gt;total_id&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Also, your two subsearches are running over All Time - not just the search range that you chose for the outer search. Did you intend to do that?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2013 04:04:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/custom-alert-condtion-for-search-query/m-p/36975#M412</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-02-21T04:04:12Z</dc:date>
    </item>
  </channel>
</rss>

