<?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 Splunk query to Check when no value is returned in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-query-to-Check-when-no-value-is-returned/m-p/563841#M10031</link>
    <description>&lt;P&gt;Scenario:&lt;/P&gt;&lt;P&gt;Example query :&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;index=XXXX name=somefile | stats count(msg) as MESSAGE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The above query will always return some count.&lt;/P&gt;&lt;P&gt;I want to alert if the Message=0 for two consecutive 5 min interval over the last 15 min interval i.e. when no values are returned.&lt;/P&gt;&lt;P&gt;earliest=-15m if two out of three interval (5min) the message=0 i want to take some actions&lt;/P&gt;</description>
    <pubDate>Wed, 18 Aug 2021 19:15:19 GMT</pubDate>
    <dc:creator>masmi99</dc:creator>
    <dc:date>2021-08-18T19:15:19Z</dc:date>
    <item>
      <title>Splunk query to Check when no value is returned</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-query-to-Check-when-no-value-is-returned/m-p/563841#M10031</link>
      <description>&lt;P&gt;Scenario:&lt;/P&gt;&lt;P&gt;Example query :&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;index=XXXX name=somefile | stats count(msg) as MESSAGE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The above query will always return some count.&lt;/P&gt;&lt;P&gt;I want to alert if the Message=0 for two consecutive 5 min interval over the last 15 min interval i.e. when no values are returned.&lt;/P&gt;&lt;P&gt;earliest=-15m if two out of three interval (5min) the message=0 i want to take some actions&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 19:15:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-query-to-Check-when-no-value-is-returned/m-p/563841#M10031</guid>
      <dc:creator>masmi99</dc:creator>
      <dc:date>2021-08-18T19:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to Check when no value is returned</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-query-to-Check-when-no-value-is-returned/m-p/563842#M10032</link>
      <description>&lt;P&gt;Just add this to the end of your alert query:&lt;BR /&gt;&lt;BR /&gt;| where result_count=0&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 19:26:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-query-to-Check-when-no-value-is-returned/m-p/563842#M10032</guid>
      <dc:creator>codebuilder</dc:creator>
      <dc:date>2021-08-18T19:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to Check when no value is returned</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-query-to-Check-when-no-value-is-returned/m-p/563845#M10033</link>
      <description>&lt;P&gt;when i add where MESSAGE=0 it is not returning any result&lt;/P&gt;&lt;P&gt;As my intention is to check for last 15 min if two of 5 min interval does not get any result to do some other action&lt;/P&gt;&lt;P&gt;index=XXX name=file-XXX level&amp;lt;50&lt;BR /&gt;| bucket _time span=5m&lt;BR /&gt;| fillnull value=0&lt;BR /&gt;| stats count(msg) as MESSAGES by _time&lt;/P&gt;&lt;P&gt;tried this but this will provide the result as follows it skipped 3:25 when&amp;nbsp; the count was 0&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;2021-08-18 03:20:00&lt;/TD&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2021-08-18 03:30:00&lt;/TD&gt;&lt;TD&gt;139&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2021-08-18 03:35:00&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 18 Aug 2021 19:32:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-query-to-Check-when-no-value-is-returned/m-p/563845#M10033</guid>
      <dc:creator>masmi99</dc:creator>
      <dc:date>2021-08-18T19:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to Check when no value is returned</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-query-to-Check-when-no-value-is-returned/m-p/563857#M10034</link>
      <description>&lt;P&gt;The problem with you query is that you are not eliminating events where "msg" has a non null value. That's why youre getting results with counts.&lt;BR /&gt;&lt;BR /&gt;Try something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=XXX name=file-XXX | fields + msg level&amp;lt;50
| bucket _time span=5m
| fillnull value=0
| where msg=0
| stats count(msg) as MESSAGES by _time&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 18 Aug 2021 20:24:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-query-to-Check-when-no-value-is-returned/m-p/563857#M10034</guid>
      <dc:creator>codebuilder</dc:creator>
      <dc:date>2021-08-18T20:24:00Z</dc:date>
    </item>
  </channel>
</rss>

