<?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 to send an alert when search count is 0 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-an-alert-when-search-count-is-0/m-p/574589#M200235</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240460"&gt;@rajs115&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;your search is larger than what you need, you could simply run:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="logs"&lt;/LI-CODE&gt;&lt;P&gt;and put the condition results=0 in the alert.&lt;/P&gt;&lt;P&gt;Only one note: use always the condition index=your_index in your searches, because searchjes are quicker and otherwise you risk not using some indexes out of the default path.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 11 Nov 2021 15:09:23 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2021-11-11T15:09:23Z</dc:date>
    <item>
      <title>How to send an alert when search count is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-an-alert-when-search-count-is-0/m-p/574493#M200209</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I am looking for a solution to check the splunk query results . if it returns '0' events i need to trigger an alert. Please provide a query to check when count value is zero.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 20:24:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-an-alert-when-search-count-is-0/m-p/574493#M200209</guid>
      <dc:creator>rajs115</dc:creator>
      <dc:date>2021-11-10T20:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to send an alert when search count is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-an-alert-when-search-count-is-0/m-p/574495#M200211</link>
      <description>&lt;P&gt;one more thing that, i need to run this query for every 1 hour. If count is '0' for the last one hour of the search i need to send alert&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 20:41:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-an-alert-when-search-count-is-0/m-p/574495#M200211</guid>
      <dc:creator>rajs115</dc:creator>
      <dc:date>2021-11-10T20:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to send an alert when search count is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-an-alert-when-search-count-is-0/m-p/574528#M200219</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240460"&gt;@rajs115&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;when you say "count=0" are you meaning that you haven't any result to your search or that you want to test e.g. a list of hosts and identyfy the ones with no events?&lt;/P&gt;&lt;P&gt;If the first, you have to create an alert with your search and set the condition "count=0" in the Alert conditions.&lt;/P&gt;&lt;P&gt;If instead, the second, you have to create a list of hosts to check in a lookup (called e.g. "perimeter.csv" containing at least one field ("host") and then run a search like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| metasearch index=_internal
| eval host=lower(host)
| stats count BY host
| append [ | inputlookup perimeter.csv | eval host=lower(host), count=0 | fields host count ]
| stats sum(count) AS total BY host
| where total=0&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 07:32:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-an-alert-when-search-count-is-0/m-p/574528#M200219</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-11-11T07:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to send an alert when search count is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-an-alert-when-search-count-is-0/m-p/574574#M200230</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Yes, its the solution as you mentioned. I am running a basic query to look for the events over the last 1 hour of time and when the count is '0' i have to send an alert. Below query i am running. Can you please check if its right? Also, how to mention time period in last 1 hour in my search query?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sourcetype="logs" | stats count | where count=0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 13:42:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-an-alert-when-search-count-is-0/m-p/574574#M200230</guid>
      <dc:creator>rajs115</dc:creator>
      <dc:date>2021-11-11T13:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to send an alert when search count is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-an-alert-when-search-count-is-0/m-p/574589#M200235</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240460"&gt;@rajs115&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;your search is larger than what you need, you could simply run:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="logs"&lt;/LI-CODE&gt;&lt;P&gt;and put the condition results=0 in the alert.&lt;/P&gt;&lt;P&gt;Only one note: use always the condition index=your_index in your searches, because searchjes are quicker and otherwise you risk not using some indexes out of the default path.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 15:09:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-an-alert-when-search-count-is-0/m-p/574589#M200235</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-11-11T15:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to send an alert when search count is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-an-alert-when-search-count-is-0/m-p/574590#M200236</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;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;How can i add time in my query for the time (last 1 hour) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 15:12:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-an-alert-when-search-count-is-0/m-p/574590#M200236</guid>
      <dc:creator>rajs115</dc:creator>
      <dc:date>2021-11-11T15:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to send an alert when search count is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-an-alert-when-search-count-is-0/m-p/574593#M200239</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240460"&gt;@rajs115&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have two ways to do this:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;defini with the Time Picker the time period of one hour for your search and then save the search as an alert, in this way the time period is associated to your search;&lt;/LI&gt;&lt;LI&gt;otherwise you can insert the following condition in your search:&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="logs" earliest=-1h latest=now&lt;/LI-CODE&gt;&lt;P&gt;I hint to follow the Search Tutorial at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/WelcometotheSearchTutorial" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/WelcometotheSearchTutorial&lt;/A&gt;&amp;nbsp;that explain hot to search in Splunk.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 15:25:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-an-alert-when-search-count-is-0/m-p/574593#M200239</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-11-11T15:25:48Z</dc:date>
    </item>
  </channel>
</rss>

