<?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 How to have stats with no result found in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-have-stats-with-no-result-found/m-p/476028#M133734</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm looking at logs on a Gateway to see if there is traffic or not for specific files at a specific time. &lt;BR /&gt;
I want to show the status of the flow. &lt;/P&gt;

&lt;P&gt;The file has to be present only on Monday between 5:30PM and 7:30PM.&lt;BR /&gt;
If it is then the state is "OK" and "KO" if not.&lt;BR /&gt;
If we are another day and there that is no traffic, it's "Not expected"&lt;BR /&gt;
Otherwise, it's a warn.&lt;/P&gt;

&lt;P&gt;Could you please help ?&lt;/P&gt;

&lt;P&gt;Here is my command line :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=echanges IDF="KB0N3A*" OR IDF="N70N3A*" ENDTIME&amp;gt;"17:30:00" ENDTIME&amp;lt;"19:30:00" RECEPTEUR="FGPXYG00" STATUS="COMPLETED" VOLUMETRIE&amp;gt;0 | stats count as Nb by IDF,date_wday | eval State = if(Nb == 1,if(match(date_wday, "monday"),"OK","Warning"),if(match(date_wday,"monday"),"Warning","Not Expected")) | table State
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 12 Sep 2019 11:32:07 GMT</pubDate>
    <dc:creator>pbd</dc:creator>
    <dc:date>2019-09-12T11:32:07Z</dc:date>
    <item>
      <title>How to have stats with no result found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-have-stats-with-no-result-found/m-p/476028#M133734</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm looking at logs on a Gateway to see if there is traffic or not for specific files at a specific time. &lt;BR /&gt;
I want to show the status of the flow. &lt;/P&gt;

&lt;P&gt;The file has to be present only on Monday between 5:30PM and 7:30PM.&lt;BR /&gt;
If it is then the state is "OK" and "KO" if not.&lt;BR /&gt;
If we are another day and there that is no traffic, it's "Not expected"&lt;BR /&gt;
Otherwise, it's a warn.&lt;/P&gt;

&lt;P&gt;Could you please help ?&lt;/P&gt;

&lt;P&gt;Here is my command line :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=echanges IDF="KB0N3A*" OR IDF="N70N3A*" ENDTIME&amp;gt;"17:30:00" ENDTIME&amp;lt;"19:30:00" RECEPTEUR="FGPXYG00" STATUS="COMPLETED" VOLUMETRIE&amp;gt;0 | stats count as Nb by IDF,date_wday | eval State = if(Nb == 1,if(match(date_wday, "monday"),"OK","Warning"),if(match(date_wday,"monday"),"Warning","Not Expected")) | table State
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Sep 2019 11:32:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-have-stats-with-no-result-found/m-p/476028#M133734</guid>
      <dc:creator>pbd</dc:creator>
      <dc:date>2019-09-12T11:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to have stats with no result found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-have-stats-with-no-result-found/m-p/476029#M133735</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=echanges IDF="KB0N3A*" OR IDF="N70N3A*" ENDTIME&amp;gt;"17:30:00" ENDTIME&amp;lt;"19:30:00" RECEPTEUR="FGPXYG00" STATUS="COMPLETED" VOLUMETRIE&amp;gt;0 
| stats count as Nb by IDF,date_wday 
| appendpipe [| stats count as Nb| where Nb=0 | eval date_wday=lower(strftime(now(),"%A"))]
| eval State = if(Nb == 1,if(match(date_wday, "monday"),"OK","Warning"),if(match(date_wday,"monday"),"Warning","Not Expected")) | table State
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Sep 2019 13:42:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-have-stats-with-no-result-found/m-p/476029#M133735</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-09-12T13:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to have stats with no result found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-have-stats-with-no-result-found/m-p/476030#M133736</link>
      <description>&lt;P&gt;Thank you for the fast reply !&lt;BR /&gt;
This would be perfect if I can replace "now()" in the strftime function by the time i'm searching for ?&lt;BR /&gt;
You put me on the right track I think. &lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 14:42:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-have-stats-with-no-result-found/m-p/476030#M133736</guid>
      <dc:creator>pbd</dc:creator>
      <dc:date>2019-09-12T14:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to have stats with no result found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-have-stats-with-no-result-found/m-p/476031#M133737</link>
      <description>&lt;P&gt;I think I've finally found !!! \o/&lt;/P&gt;

&lt;P&gt;eventtype=echanges IDF="KB0N3A*" OR IDF="N70N3A*" ENDTIME&amp;gt;"17:30:00" ENDTIME&amp;lt;"19:30:00" RECEPTEUR="FGPXYG00" STATUS="COMPLETED" VOLUMETRIE&amp;gt;0 | stats count as Nb by IDF,date_wday | appendpipe [| stats count as Nb| where Nb=0 | addinfo | eval date_wday=lower(strftime(info_min_time,"%A"))] | eval State = if(Nb == 1,if(match(date_wday, "monday"),"OK","Warning"),if(match(date_wday,"monday"),"Warning","Not Expected")) | table State date_wday Nb&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:07:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-have-stats-with-no-result-found/m-p/476031#M133737</guid>
      <dc:creator>pbd</dc:creator>
      <dc:date>2020-09-30T02:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to have stats with no result found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-have-stats-with-no-result-found/m-p/476032#M133738</link>
      <description>&lt;P&gt;Thank you very much!!!!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 14:55:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-have-stats-with-no-result-found/m-p/476032#M133738</guid>
      <dc:creator>pbd</dc:creator>
      <dc:date>2019-09-12T14:55:50Z</dc:date>
    </item>
  </channel>
</rss>

