<?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 return stats from subsearch if first search  returns no events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-stats-from-subsearch-if-first-search-returns-no/m-p/582204#M202804</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/37741"&gt;@rune_hellem&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: you want to exclude results i holidays to avoid false positives, is it correct?&lt;/P&gt;&lt;P&gt;if this is your need, I solved this problem using a lookup containing all the holidays of the week, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;day          fest
2022-01-01   0
2022-01-02   0
2022-01-03   1
2022-01-04   1
2022-01-05   1
2022-01-06   0
2022-01-07   1
2022-01-08   0
2022-01-09   0
2022-01-10   1
and so on&lt;/LI-CODE&gt;&lt;P&gt;in this way you can a condition to your search to be sure that in week-ends and holidays you don't have results, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=ipl_prod source="e:\\logs\\icc-application.log" sourcetype="log4j:ipl" operationName=hentOpptjeningsperioder status=OK
| eval day=strftime(_time,"%Y-%m-%d")
| lookup calendar.csv day OUTPUT fest
| search fest=1
| ...&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;(called e.g. calendar.csv)&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jan 2022 07:22:47 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-01-24T07:22:47Z</dc:date>
    <item>
      <title>How to return stats from subsearch if first search  returns no events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-stats-from-subsearch-if-first-search-returns-no/m-p/582199#M202802</link>
      <description>&lt;P&gt;I have created a search that will trigger if no events from the following search is being returned&lt;/P&gt;&lt;PRE&gt;index=ipl_prod source="e:\\logs\\icc-application.log" sourcetype="log4j:ipl" operationName=hentOpptjeningsperioder status=OK&lt;/PRE&gt;&lt;P&gt;Search is only being triggerd during business hours Monday to Friday, problem is that I cannot instruct the cron schedule to not trigger on holidays. Holidays means no activity, so to make it a bit easier to evaluate if this is a false positive or not I want to add to the email being sent statistics of all statuses. Then we know if no other statuses has been found either, it is safe to ignore.&lt;/P&gt;&lt;PRE&gt;index=ipl_prod source="e:\\logs\\icc-application.log" sourcetype="log4j:ipl" operationName=hentOpptjeningsperioder status=OK [if no eventes then subsearch and return those events]&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Jan 2022 06:56:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-stats-from-subsearch-if-first-search-returns-no/m-p/582199#M202802</guid>
      <dc:creator>rune_hellem</dc:creator>
      <dc:date>2022-01-24T06:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to return stats from subsearch if first search  returns no events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-stats-from-subsearch-if-first-search-returns-no/m-p/582204#M202804</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/37741"&gt;@rune_hellem&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: you want to exclude results i holidays to avoid false positives, is it correct?&lt;/P&gt;&lt;P&gt;if this is your need, I solved this problem using a lookup containing all the holidays of the week, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;day          fest
2022-01-01   0
2022-01-02   0
2022-01-03   1
2022-01-04   1
2022-01-05   1
2022-01-06   0
2022-01-07   1
2022-01-08   0
2022-01-09   0
2022-01-10   1
and so on&lt;/LI-CODE&gt;&lt;P&gt;in this way you can a condition to your search to be sure that in week-ends and holidays you don't have results, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=ipl_prod source="e:\\logs\\icc-application.log" sourcetype="log4j:ipl" operationName=hentOpptjeningsperioder status=OK
| eval day=strftime(_time,"%Y-%m-%d")
| lookup calendar.csv day OUTPUT fest
| search fest=1
| ...&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;(called e.g. calendar.csv)&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 07:22:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-stats-from-subsearch-if-first-search-returns-no/m-p/582204#M202804</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-01-24T07:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to return stats from subsearch if first search  returns no events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-stats-from-subsearch-if-first-search-returns-no/m-p/582210#M202807</link>
      <description>&lt;LI-CODE lang="markup"&gt;| appendpipe
    [stats count as _rows
    | where _rows=0
    | eval status="no rows found"]&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 24 Jan 2022 07:56:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-stats-from-subsearch-if-first-search-returns-no/m-p/582210#M202807</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-01-24T07:56:07Z</dc:date>
    </item>
  </channel>
</rss>

