<?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: when no events or any field contains contains zero for past hour through an alert in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/when-no-events-or-any-field-contains-contains-zero-for-past-hour/m-p/584055#M203396</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/54377"&gt;@kirrusk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have to define a time range of calculation, e.g. every day and the run something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index latest=-1h@h earliest=@h
| bin _time span=1h
| stats count(eval(FIELD1)) AS FIELD1 count(eval(FIELD2)) AS FIELD2 count(eval(FIELD3)) AS FIELD3 BY _time
| append [ index=_internal latest=-1h@h earliest=@h | head 1 | eval FIELD1=0, FIELD2=0, FIELD3=0| fields _time FIELD1 FIELD2 FIELD3 ]
| stats sum(FIELD1) AS FIELD1 sum(FIELD2) AS FIELD2 sum(FIELD3) AS FIELD3 BY _time
| where FIELD1=0 OR FIELD2=0 OR FIELD3=0&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Tue, 08 Feb 2022 08:00:22 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-02-08T08:00:22Z</dc:date>
    <item>
      <title>when no events or any field contains contains zero for past hour through an alert</title>
      <link>https://community.splunk.com/t5/Splunk-Search/when-no-events-or-any-field-contains-contains-zero-for-past-hour/m-p/584053#M203394</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to trigger an alert for the below scenarios (one alert).&lt;BR /&gt;&lt;BR /&gt;scenario one: when there are no events, trigger alert.&lt;BR /&gt;Scenario two: When any of the fields contains (Zero) for the past hour.&lt;BR /&gt;&lt;BR /&gt;DATE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FIELD1&amp;nbsp; FIELD2&amp;nbsp; FIELD3&lt;BR /&gt;2-8-2022&amp;nbsp; &amp;nbsp;45&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;56&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;67&lt;BR /&gt;2-8-2022&amp;nbsp; &amp;nbsp;54&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;67&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;87&lt;BR /&gt;2-8-2022&amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 56&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;BR /&gt;2-8-2022&amp;nbsp; &amp;nbsp;543&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 56&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 676&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Trigger an alert if (no events) are coming for any particular field or a field contains (Zero) in the past hour.&lt;BR /&gt;&lt;BR /&gt;For example : the above table needs to trigger an alert by giving a table as result.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 07:53:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/when-no-events-or-any-field-contains-contains-zero-for-past-hour/m-p/584053#M203394</guid>
      <dc:creator>kirrusk</dc:creator>
      <dc:date>2022-02-08T07:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: when no events or any field contains contains zero for past hour through an alert</title>
      <link>https://community.splunk.com/t5/Splunk-Search/when-no-events-or-any-field-contains-contains-zero-for-past-hour/m-p/584055#M203396</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/54377"&gt;@kirrusk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have to define a time range of calculation, e.g. every day and the run something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index latest=-1h@h earliest=@h
| bin _time span=1h
| stats count(eval(FIELD1)) AS FIELD1 count(eval(FIELD2)) AS FIELD2 count(eval(FIELD3)) AS FIELD3 BY _time
| append [ index=_internal latest=-1h@h earliest=@h | head 1 | eval FIELD1=0, FIELD2=0, FIELD3=0| fields _time FIELD1 FIELD2 FIELD3 ]
| stats sum(FIELD1) AS FIELD1 sum(FIELD2) AS FIELD2 sum(FIELD3) AS FIELD3 BY _time
| where FIELD1=0 OR FIELD2=0 OR FIELD3=0&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 08:00:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/when-no-events-or-any-field-contains-contains-zero-for-past-hour/m-p/584055#M203396</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-02-08T08:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: when no events or any field contains contains zero for past hour through an alert</title>
      <link>https://community.splunk.com/t5/Splunk-Search/when-no-events-or-any-field-contains-contains-zero-for-past-hour/m-p/584064#M203402</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;Thank you, it's working&amp;nbsp;&lt;BR /&gt;it's my bad not tell about query what I'm using.&lt;BR /&gt;I'm trying to use tstats&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So modified query like below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats count WHERE index=your_index AND(TMPFIELD="FIELD1" OR TMPFIELD="FIELD2" OR TMPFIELD="FIELD3") GROUPBY index TMPFIELD _time latest=-1h@h earliest=@h
| timechart count(eval(FIELD1)) AS FIELD1 count(eval(FIELD2)) AS FIELD2 count(eval(FIELD3)) AS FIELD3 
| append [ index=_internal latest=-1h@h earliest=@h | head 1 | eval FIELD1=0, FIELD2=0, FIELD3=0| fields _time FIELD1 FIELD2 FIELD3 ]
| stats sum(FIELD1) AS FIELD1 sum(FIELD2) AS FIELD2 sum(FIELD3) AS FIELD3 BY _time
| where FIELD1=0 OR FIELD2=0 OR FIELD3=0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But problem is, it's giving zero in the table if data is present in the field also&lt;/P&gt;&lt;P&gt;EXAMPLE,&lt;BR /&gt;FIELD1&amp;nbsp; &amp;nbsp; FIELD2&amp;nbsp; &amp;nbsp;FIELD3&lt;BR /&gt;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;BR /&gt;&lt;BR /&gt;But in reality, field3 has values&lt;BR /&gt;FIELD1&amp;nbsp; &amp;nbsp; FIELD2&amp;nbsp; &amp;nbsp;FIELD3&lt;BR /&gt;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;59&lt;BR /&gt;&lt;BR /&gt;so it should through alert as well, because&amp;nbsp;FIELD1 &amp;amp;&amp;nbsp;FIELD2 are Zero.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 09:47:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/when-no-events-or-any-field-contains-contains-zero-for-past-hour/m-p/584064#M203402</guid>
      <dc:creator>kirrusk</dc:creator>
      <dc:date>2022-02-08T09:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: when no events or any field contains contains zero for past hour through an alert</title>
      <link>https://community.splunk.com/t5/Splunk-Search/when-no-events-or-any-field-contains-contains-zero-for-past-hour/m-p/584065#M203403</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/54377"&gt;@kirrusk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;tstats is always a good approach!&lt;/P&gt;&lt;P&gt;good for you, see next time, please accept one answer for the other people of Community.&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 09:46:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/when-no-events-or-any-field-contains-contains-zero-for-past-hour/m-p/584065#M203403</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-02-08T09:46:21Z</dc:date>
    </item>
  </channel>
</rss>

