<?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: EVAL separate search for Monday in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288558#M87374</link>
    <description>&lt;P&gt;Thank you very much, this worked!&lt;/P&gt;</description>
    <pubDate>Mon, 26 Mar 2018 13:13:38 GMT</pubDate>
    <dc:creator>davidcraven02</dc:creator>
    <dc:date>2018-03-26T13:13:38Z</dc:date>
    <item>
      <title>EVAL separate search for Monday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288548#M87364</link>
      <description>&lt;P&gt;Each Monday the event count for skypeuk is 30 and skypeus is 200. However, for the rest of the weekday skypeuk is atleast is 290 and skypeus is 700.&lt;/P&gt;

&lt;P&gt;How would I build in a new search to the one below to accommodate this low event count on Monday? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count as "Data Received" where index=msexchange host=opspkhf03p    source=skypeuk
| eval result=if('Data Received'&amp;gt; 200, "PASS", "FAIL")
| eval host="opspkhf03p"
| append 
    [| tstats count as "Data Received" where  index=msexchange   host=opspkhf03p source=skypeus
| eval result=if('Data Received'&amp;gt; 700, "PASS", "FAIL")
| eval host="opspkhf03p"]
| table host, "Data Received", result
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Mar 2018 08:13:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288548#M87364</guid>
      <dc:creator>davidcraven02</dc:creator>
      <dc:date>2018-03-26T08:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: EVAL separate search for Monday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288549#M87365</link>
      <description>&lt;P&gt;Hey&lt;/P&gt;

&lt;P&gt;What exactly do you want to achieve here? &lt;BR /&gt;
What do you want to do with the Monday case?  Is it different? Do you have different PASS/FAIL thresholds you want to have just for Mondays?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 08:16:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288549#M87365</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-26T08:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: EVAL separate search for Monday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288550#M87366</link>
      <description>&lt;P&gt;I would like for it to check if it is Monday and use the below pseudo-code logic &lt;/P&gt;

&lt;P&gt;for skypeuk&lt;BR /&gt;
If dayOfWeek=Monday&lt;BR /&gt;
check if event count (Data Received) is greater than equals 290 then PASS else FAIL&lt;/P&gt;

&lt;P&gt;for skypeus&lt;BR /&gt;
If dayOfWeek=Monday&lt;BR /&gt;
check if event count (Data Received) is greater than equals 700 then PASS else FAIL&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 08:21:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288550#M87366</guid>
      <dc:creator>davidcraven02</dc:creator>
      <dc:date>2018-03-26T08:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: EVAL separate search for Monday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288551#M87367</link>
      <description>&lt;P&gt;You can do the tstats by _time and then evaluate if it is a Monday or not:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=_internal by _time span=1d
| eval date_wday=strftime(_time,"%A")
| eval result=if(count&amp;gt; 700 AND date_wday=="Monday", "PASS", "FAIL")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Mar 2018 08:27:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288551#M87367</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-26T08:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: EVAL separate search for Monday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288552#M87368</link>
      <description>&lt;P&gt;Thanks for this. I ran this but it is saying fail with the below search. When adding date_wday to the table it has no value.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count as "Data Received" where  index=msexchange     host=opspkhf03p source=skypeuk
 | eval date_wday=strftime(_time,"%A")
 | eval result=if(count&amp;gt; 30 AND date_wday=="Monday", "PASS", "FAIL")
 | eval host="opspkhf03p"
   | append 
     [| tstats count as "Data Received" where  index=msexchange     host=opspkhf03p source=skypeus
 | eval date_wday=strftime(_time,"%A")
 | eval result=if(count&amp;gt; 200 AND date_wday=="Monday", "PASS", "FAIL")
 | eval host="opspkhf03p"]
 | table host, "Data Received", result
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Mar 2018 11:28:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288552#M87368</guid>
      <dc:creator>davidcraven02</dc:creator>
      <dc:date>2018-03-26T11:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: EVAL separate search for Monday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288553#M87369</link>
      <description>&lt;P&gt;Yes because your did not put the tstats &lt;STRONG&gt;by _time&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;| tstats count where index=_internal by _time span=1d&lt;/STRONG&gt;&lt;BR /&gt;
 | eval date_wday=strftime(_time,"%A")&lt;BR /&gt;
 | eval result=if(count&amp;gt; 700 AND date_wday=="Monday", "PASS", "FAIL")&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:40:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288553#M87369</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2020-09-29T18:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: EVAL separate search for Monday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288554#M87370</link>
      <description>&lt;P&gt;How can I run&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count where index=_internal by _time span=1d 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with my first line&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  tstats count as "Data Received" where  index=msexchange     host=opspkhf03p source=skypeuk
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;They don't run together. Am I explaining myself correctly?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 11:58:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288554#M87370</guid>
      <dc:creator>davidcraven02</dc:creator>
      <dc:date>2018-03-26T11:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: EVAL separate search for Monday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288555#M87371</link>
      <description>&lt;P&gt;They can run together of you put it like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; |  tstats count as "Data Received"  where  index=msexchange     host=opspkhf03p source=skypeuk by _time  span =1d 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Mar 2018 12:00:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288555#M87371</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-26T12:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: EVAL separate search for Monday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288556#M87372</link>
      <description>&lt;P&gt;Thanks I appreciate your help on this. Now I'm receiving two rows and both are FAIL when running with Last 24 hours&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4617iE4E6515A149BD48F/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 12:22:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288556#M87372</guid>
      <dc:creator>davidcraven02</dc:creator>
      <dc:date>2018-03-26T12:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: EVAL separate search for Monday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288557#M87373</link>
      <description>&lt;P&gt;That is happening because your search is also going through the 25th of March which is Sunday.&lt;/P&gt;

&lt;P&gt;If in the end you put the &lt;STRONG&gt;date_wday&lt;/STRONG&gt; in the table you will get one row for Sunday and another for Monday.&lt;/P&gt;

&lt;P&gt;If you just want the data for Monday, then just filter that one out like I;m showing below. If not, just have the results per date_wday where you can see Monday results but also any other days you want. It is up to you.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  |  tstats count as "Data Received"  where  index=msexchange     host=opspkhf03p source=skypeuk by _time  span =1d 
 | eval date_wday=strftime(_time,"%A")
  | where date_wday=="Monday"
  | eval result=if(count&amp;gt; 30 AND date_wday=="Monday", "PASS", "FAIL")
  | eval host="opspkhf03p"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Mar 2018 12:31:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288557#M87373</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-26T12:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: EVAL separate search for Monday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288558#M87374</link>
      <description>&lt;P&gt;Thank you very much, this worked!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 13:13:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EVAL-separate-search-for-Monday/m-p/288558#M87374</guid>
      <dc:creator>davidcraven02</dc:creator>
      <dc:date>2018-03-26T13:13:38Z</dc:date>
    </item>
  </channel>
</rss>

