<?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: Why is the search for my alert returning 0 results? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-search-for-my-alert-returning-0-results/m-p/274948#M82933</link>
    <description>&lt;P&gt;Check if there is any delay in indexing the events ,which means when the search ran, the events were not there and the alert fired. By the time you checked manually the events might have arrived.&lt;/P&gt;

&lt;P&gt;You can do as below to find the lag in your events&lt;/P&gt;

&lt;PRE&gt;| eval delay = _indextime - _time&lt;/PRE&gt;</description>
    <pubDate>Wed, 20 Jul 2016 03:27:22 GMT</pubDate>
    <dc:creator>pradeepkumarg</dc:creator>
    <dc:date>2016-07-20T03:27:22Z</dc:date>
    <item>
      <title>Why is the search for my alert returning 0 results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-search-for-my-alert-returning-0-results/m-p/274947#M82932</link>
      <description>&lt;P&gt;I currently have some alerts being triggered when they shouldn't be. The search is performing a host alive check, where the host is sending an event every second. The search is looking over a period of 1 minute, so it should be returning 60 events. An email will be sent if the event count is &amp;lt; 50. This search is scheduled to run as a cron job, to run every minute&lt;BR /&gt;
The time frame of the alert is -3@m to -2@m, this was set to make sure there wasn't and issue with searching most recent event. &lt;/P&gt;

&lt;P&gt;Randomly the alert will be triggered, but when I view the alert, 60 events are shown in the search. Also when I run the search manually, 60 events are returned. &lt;/P&gt;

&lt;P&gt;Looking into this further, I have looked in _audit for events related to the specific search. What I have noticed is that when the alert is triggered, the search results return nothing.&lt;/P&gt;

&lt;P&gt;Sample of normal result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;action=search, info=completed, search_id=&amp;lt;SEARCH_ID&amp;gt;, total_run_time=0.46, event_count=60, result_count=60, avaliable_count=60, scan_count=60, drop_count=60 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When an alert is triggered:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;action=search, info=completed, search_id=&amp;lt;SEARCH_ID&amp;gt;, total_run_time=0.45, event_count=0, result_count=0, avaliable_count=0, scan_count=0, drop_count=0 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can't work out why the search is returning 0 results. To me it appears as if the search didn't run or was unable to run correctly.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 01:31:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-search-for-my-alert-returning-0-results/m-p/274947#M82932</guid>
      <dc:creator>matthew_dorring</dc:creator>
      <dc:date>2016-07-20T01:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the search for my alert returning 0 results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-search-for-my-alert-returning-0-results/m-p/274948#M82933</link>
      <description>&lt;P&gt;Check if there is any delay in indexing the events ,which means when the search ran, the events were not there and the alert fired. By the time you checked manually the events might have arrived.&lt;/P&gt;

&lt;P&gt;You can do as below to find the lag in your events&lt;/P&gt;

&lt;PRE&gt;| eval delay = _indextime - _time&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jul 2016 03:27:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-search-for-my-alert-returning-0-results/m-p/274948#M82933</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2016-07-20T03:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the search for my alert returning 0 results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-search-for-my-alert-returning-0-results/m-p/274949#M82934</link>
      <description>&lt;P&gt;Use below query, to find out what  was the result count when the search was executed. There are result_count and fired field which can give more insight.&lt;/P&gt;

&lt;P&gt;index=_internal source=*scheduler.log savedsearch_name="Name of your saved seach"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:20:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-search-for-my-alert-returning-0-results/m-p/274949#M82934</guid>
      <dc:creator>hardikJsheth</dc:creator>
      <dc:date>2020-09-29T10:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the search for my alert returning 0 results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-search-for-my-alert-returning-0-results/m-p/274950#M82935</link>
      <description>&lt;P&gt;I will give that a shot and see what the result is, although I attempted to account for an index delay by using a time range of -10@m to &lt;A href="mailto:-9@m"&gt;-9@m&lt;/A&gt;. Alerts were still being triggered, with the audit logs showing the same result.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 08:58:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-search-for-my-alert-returning-0-results/m-p/274950#M82935</guid>
      <dc:creator>matthew_dorring</dc:creator>
      <dc:date>2016-07-20T08:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the search for my alert returning 0 results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-search-for-my-alert-returning-0-results/m-p/274951#M82936</link>
      <description>&lt;P&gt;I run the above search with the savedsearch, on a period when the Alert was triggered. The result count was 0, when I kicked the search manually within the same timeframe, I got a return of 60 events.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 21:55:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-search-for-my-alert-returning-0-results/m-p/274951#M82936</guid>
      <dc:creator>matthew_dorring</dc:creator>
      <dc:date>2016-07-20T21:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the search for my alert returning 0 results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-search-for-my-alert-returning-0-results/m-p/274952#M82937</link>
      <description>&lt;P&gt;I have added this to the savedsearch and the delay is 0, there are breif periods when it is 1 second.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 21:57:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-search-for-my-alert-returning-0-results/m-p/274952#M82937</guid>
      <dc:creator>matthew_dorring</dc:creator>
      <dc:date>2016-07-20T21:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the search for my alert returning 0 results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-search-for-my-alert-returning-0-results/m-p/274953#M82938</link>
      <description>&lt;P&gt;If the alert return a result 0 then i need to rerun the alert.&lt;BR /&gt;
Can anybody tell me how to do it ?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 07:01:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-search-for-my-alert-returning-0-results/m-p/274953#M82938</guid>
      <dc:creator>ydeveloper</dc:creator>
      <dc:date>2018-04-16T07:01:53Z</dc:date>
    </item>
  </channel>
</rss>

