<?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: Alert query not triggering an alert in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Alert-query-not-triggering-an-alert/m-p/563773#M12925</link>
    <description>&lt;P&gt;Debug the query by running it one pipe at a time until you find where it fails to return results.&lt;/P&gt;&lt;P&gt;Are you sure you have the math right?&amp;nbsp; Perhaps you mean &amp;lt; rather than &amp;gt; ?&lt;/P&gt;</description>
    <pubDate>Wed, 18 Aug 2021 12:53:59 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2021-08-18T12:53:59Z</dc:date>
    <item>
      <title>Alert query not triggering an alert</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-query-not-triggering-an-alert/m-p/563758#M12924</link>
      <description>&lt;P&gt;Hi, I have a sample log like below, for which I have created an alert which triggers if the &lt;STRONG&gt;Expiration Date&lt;/STRONG&gt; is greater than current date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOGS:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Date : 17/08/2021 12:15:44
Build Number : 3274
Database Date : 2021-07-15
Expiration Date : 2021-08-17
License Expiration Date : 2021-08-17&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MY QUERY:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myIdx source="/my/logs/catalina.out" linecount=4 | regex _raw = ".*\sExpiration Date\s.*" | rex max_match=0 "^(?&amp;lt;lines&amp;gt;.+)\n+" | eval buildNumber=mvindex(lines,0) | eval expirationDate=mvindex(lines,2) | fields - lines | eval expirationDateVal = mvindex(split(expirationDate,":"),1) | eval buildNumberVal = mvindex(split(buildNumber,":"),1) | eval expiredConvert = strptime(expirationDateVal,"%m-%d-%Y") |eval expiredConvertDiffFormat = strptime(expirationDateVal,"%Y-%m-%d") | eval remDays =round((expiredConvert-now())/86400) | eval remDaysDiffFormat =round((expiredConvertDiffFormat-now())/86400) | where ( remDays &amp;lt;= 15 and remDays != "" ) or ( remDaysDiffFormat !="" and remDaysDiffFormat &amp;lt;= 15 ) | rename remDays as numDays remDaysDiffFormat as numDaysDiffFormat host as host |eval remainingDays =case(numDays!="",numDays,numDaysDiffFormat!="",numDaysDiffFormat)| where remainingDays &amp;gt; 0 | table remainingDays,host,buildNumberVal,expirationDate&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Somehow, this query is not pulling up the logs. Is there something which I am missing in my query? The alert should have triggered yesterday. But it hasn't. Kindly help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 11:31:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-query-not-triggering-an-alert/m-p/563758#M12924</guid>
      <dc:creator>Nidd</dc:creator>
      <dc:date>2021-08-18T11:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Alert query not triggering an alert</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-query-not-triggering-an-alert/m-p/563773#M12925</link>
      <description>&lt;P&gt;Debug the query by running it one pipe at a time until you find where it fails to return results.&lt;/P&gt;&lt;P&gt;Are you sure you have the math right?&amp;nbsp; Perhaps you mean &amp;lt; rather than &amp;gt; ?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 12:53:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-query-not-triggering-an-alert/m-p/563773#M12925</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-08-18T12:53:59Z</dc:date>
    </item>
  </channel>
</rss>

