<?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 Is this search achievable? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167783#M47773</link>
    <description>&lt;P&gt;My date is like this,&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;The first and last event occur at random time every day&lt;/LI&gt;
&lt;LI&gt;The number of events are also random&lt;/LI&gt;
&lt;LI&gt;Each event consist of 2 values, say A and B&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Is it possible for splunk to return all date that meet the following, how?&lt;/P&gt;

&lt;P&gt;Every day, for the first 5 events, note the highest of A (say high-A), note the lowest of B (say low-B).  For the 6th event onwards till the last event, once A is higher than high-A, B is not lower that low-B.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Aug 2014 14:45:02 GMT</pubDate>
    <dc:creator>calvintkng</dc:creator>
    <dc:date>2014-08-01T14:45:02Z</dc:date>
    <item>
      <title>Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167783#M47773</link>
      <description>&lt;P&gt;My date is like this,&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;The first and last event occur at random time every day&lt;/LI&gt;
&lt;LI&gt;The number of events are also random&lt;/LI&gt;
&lt;LI&gt;Each event consist of 2 values, say A and B&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Is it possible for splunk to return all date that meet the following, how?&lt;/P&gt;

&lt;P&gt;Every day, for the first 5 events, note the highest of A (say high-A), note the lowest of B (say low-B).  For the 6th event onwards till the last event, once A is higher than high-A, B is not lower that low-B.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2014 14:45:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167783#M47773</guid>
      <dc:creator>calvintkng</dc:creator>
      <dc:date>2014-08-01T14:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167784#M47774</link>
      <description>&lt;P&gt;So basically for every day, you need events from 6th to last entry of the day where A is higher than MaxA of first 5 entries OR (or AND confirm) where B is lower than MinB of first 5 entries?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2014 16:20:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167784#M47774</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-01T16:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167785#M47775</link>
      <description>&lt;P&gt;Hi @somesoni2&lt;/P&gt;

&lt;P&gt;The last part is "B is NOT lower than low-B" in case you're currently working on the search.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2014 17:16:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167785#M47775</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2014-08-01T17:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167786#M47776</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search giving _time fieldA fieldB | bucket span=1d _time | streamstats count as sno by _time | eval sno=if(sno&amp;lt;6,_time,null()) | eventstats max(fieldA) as MaxfieldA min(fieldB) as MinfieldB by sno| fillnull value=0 MaxfieldA MinfieldB | eventstats max(MaxfieldA) as MaxfieldA max(MinfieldB) as MinfieldB by _time | where isnull(sno) AND fieldA&amp;gt;MaxfieldA AND fieldB&amp;gt;=MinfieldB
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Update 2&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Assuming that you have indexed your data in Splunk and fields &lt;STRONG&gt;Date, High and Low&lt;/STRONG&gt; are available (say by executing 'index=yourIndexName sourcetype=yourSourceTypeName', then the query will be like this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourIndexName sourcetype=yourSourceTypeName | streamstats count as sno by Date | eval sno=if(sno&amp;lt;6,Date,null())| eventstats max(High) as MaxHigh min(Low) as MinLow by sno| fillnull value=0 MaxHigh MinLow | eventstats max(MaxHigh) as MaxHigh max(MinLow) as MinLow by Date | where isnull(sno) AND High&amp;gt;MaxHigh AND Low&amp;gt;=MinLow 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Aug 2014 17:36:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167786#M47776</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-01T17:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167787#M47777</link>
      <description>&lt;P&gt;Thanks Patric for pointing that out. I had missed it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2014 17:37:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167787#M47777</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-01T17:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167788#M47778</link>
      <description>&lt;P&gt;Thanks somesoni2 for the quick response.  However as I found the timestamp of my data messed up, I need to re-organized it first before I can know this work or not.  Just give me a few days for this.  Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Aug 2014 15:55:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167788#M47778</guid>
      <dc:creator>calvintkng</dc:creator>
      <dc:date>2014-08-03T15:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167789#M47779</link>
      <description>&lt;P&gt;I use this search string,&lt;BR /&gt;
your base search giving _time High Low | bucket span=1d _time | streamstats count as sno by _time | eval sno=if(sno&amp;lt;6,_time,null()) | eventstats max(High) as MaxHigh min(Low) as MinLow by sno| fillnull value=0 MaxHigh MinLow | eventstats max(MaxHigh) as MaxHigh max(MinLow) as MinLow by _time | where isnull(sno) AND High&amp;gt;MaxHigh AND Low&amp;gt;=MinLow&lt;/P&gt;

&lt;P&gt;but nothing return &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;BTW, would you mind explain or point me to somewhere that I can know what this search string mean?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:15:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167789#M47779</guid>
      <dc:creator>calvintkng</dc:creator>
      <dc:date>2020-09-28T17:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167790#M47780</link>
      <description>&lt;P&gt;This is my data,&lt;/P&gt;

&lt;P&gt;Date/Time; High; Low&lt;BR /&gt;
20140701 09:00; 100; 99&lt;BR /&gt;
20140701 09:05; 99; 98&lt;BR /&gt;
20140701 09:15; 96; 95&lt;BR /&gt;
20140701 09:30; 95; 94&lt;BR /&gt;
20140701 09:44; 95; 94&lt;BR /&gt;
20140701 10:05; 94; 93&lt;BR /&gt;
20140701 11:11; 95; 94&lt;BR /&gt;
20140701 12:30; 96; 95&lt;BR /&gt;
20140701 13:33; 96; 95&lt;BR /&gt;
20140701 14:23; 95; 94&lt;BR /&gt;
20140701 15:12; 96; 95&lt;BR /&gt;
20140701 16:20; 96; 95&lt;BR /&gt;
20140701 17:30; 97; 96&lt;BR /&gt;
20140701 18:45; 96; 95&lt;BR /&gt;
20140701 19:22; 95; 94&lt;BR /&gt;
20140701 20:48; 96; 94&lt;BR /&gt;
20140701 21:38; 97; 96&lt;BR /&gt;
20140701 22:58; 96; 95&lt;BR /&gt;
20140701 23:58; 95; 94&lt;/P&gt;</description>
      <pubDate>Tue, 05 Aug 2014 06:08:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167790#M47780</guid>
      <dc:creator>calvintkng</dc:creator>
      <dc:date>2014-08-05T06:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167791#M47781</link>
      <description>&lt;P&gt;20140702 01:11; 94; 93&lt;BR /&gt;
20140702 01:18; 93; 92&lt;BR /&gt;
20140702 02:48; 92; 91&lt;BR /&gt;
20140702 03:34; 91; 90&lt;BR /&gt;
20140702 04:03; 90; 88&lt;BR /&gt;
20140702 04:53; 86; 82&lt;BR /&gt;
20140702 05:33; 82; 81&lt;BR /&gt;
20140702 06:23; 81; 80&lt;BR /&gt;
20140702 07:43; 80; 80&lt;BR /&gt;
20140702 08:33; 81; 80&lt;BR /&gt;
20140702 09:11; 82; 81&lt;BR /&gt;
20140702 10:00; 83; 82&lt;BR /&gt;
20140702 10:25; 84; 83&lt;BR /&gt;
20140702 11:19; 85; 84&lt;BR /&gt;
20140702 12:22; 84; 83&lt;BR /&gt;
20140702 13:12; 83; 82&lt;BR /&gt;
20140702 13:17; 82; 81&lt;BR /&gt;
20140702 14:47; 81; 79&lt;BR /&gt;
20140702 16:33; 78; 77&lt;BR /&gt;
20140702 17:43; 77; 76&lt;BR /&gt;
20140702 18:58; 79; 77&lt;BR /&gt;
20140702 20:14; 80; 78&lt;BR /&gt;
20140702 21:34; 81; 81&lt;BR /&gt;
20140702 22:47; 82; 81&lt;BR /&gt;
20140702 23:42; 83; 82&lt;BR /&gt;
20140702 23:59; 84; 83&lt;/P&gt;</description>
      <pubDate>Tue, 05 Aug 2014 06:08:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167791#M47781</guid>
      <dc:creator>calvintkng</dc:creator>
      <dc:date>2014-08-05T06:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167792#M47782</link>
      <description>&lt;P&gt;The first portion of the search "your base search giving _time High Low" is a placeholder for your actual search string which will give result with fields _time, fieldA which is High and fieldB which is Low. See the updated answer.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Aug 2014 12:45:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167792#M47782</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-05T12:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167793#M47783</link>
      <description>&lt;P&gt;I think it is better to use my data to explain what I need to achieve. e.g. for the first 5 events of 20140701, the highest is 100, the lowest is 94, and for the rest of 20140701, there is no higher than 100, so the search should return nothing for 20140701.&lt;/P&gt;

&lt;P&gt;Say, e.g. if an event is higher than 100 for the rest of 20140701, and then no longer below 100, the search should return 20140701.&lt;/P&gt;

&lt;P&gt;Can this be done?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2014 10:08:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167793#M47783</guid>
      <dc:creator>calvintkng</dc:creator>
      <dc:date>2014-08-06T10:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167794#M47784</link>
      <description>&lt;P&gt;Give the updated answer a try.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2014 13:11:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167794#M47784</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-06T13:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167795#M47785</link>
      <description>&lt;P&gt;Based on my data above, the search string returns all the data above back &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2014 03:06:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167795#M47785</guid>
      <dc:creator>calvintkng</dc:creator>
      <dc:date>2014-08-07T03:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167796#M47786</link>
      <description>&lt;P&gt;Try now. I had to covert string time to no.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2014 03:58:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167796#M47786</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-07T03:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167797#M47787</link>
      <description>&lt;P&gt;I added the following data&lt;BR /&gt;
20140704 09:00; 100; 99&lt;BR /&gt;
20140704 09:05; 99; 98&lt;BR /&gt;
20140704 09:15; 96; 95&lt;BR /&gt;
20140704 09:30; 95; 94&lt;BR /&gt;
20140704 09:44; 95; 94&lt;BR /&gt;
20140704 10:05; 194; 193&lt;BR /&gt;
20140704 11:11; 195; 194&lt;BR /&gt;
20140704 11:30; 196; 195&lt;BR /&gt;
20140704 13:33; 196; 195&lt;BR /&gt;
20140704 14:23; 195; 194&lt;BR /&gt;
20140704 15:12; 196; 195&lt;BR /&gt;
20140704 16:20; 196; 195&lt;BR /&gt;
20140704 17:30; 197; 196&lt;BR /&gt;
20140704 18:45; 196; 195&lt;BR /&gt;
20140704 19:22; 195; 194&lt;BR /&gt;
20140704 20:48; 196; 194&lt;BR /&gt;
20140704 21:38; 197; 196&lt;BR /&gt;
20140704 22:58; 196; 195&lt;BR /&gt;
20140703 23:58; 195; 194&lt;/P&gt;

&lt;P&gt;but this time the search string return nothing&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2014 06:51:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167797#M47787</guid>
      <dc:creator>calvintkng</dc:creator>
      <dc:date>2014-08-07T06:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167798#M47788</link>
      <description>&lt;P&gt;Lets try to breakdown the query and see what the problem is.&lt;BR /&gt;
1) execute this and let me know if you get a table with 3 columns- Date High Low with data in it.&lt;/P&gt;

&lt;P&gt;index=yourIndexName sourcetype=yourSourceTypeName | table Date High Low&lt;BR /&gt;
2)If above works, then execute this and let me know if you get table with 6 column-Date High Low sno MaxHigh MinLow, where last 3 fields have value for 1st 5 rows for a day.&lt;/P&gt;

&lt;P&gt;index=yourIndexName sourcetype=yourSourceTypeName | streamstats count as sno by Date | eval sno=if(sno&amp;lt;6,Date,null())| eventstats max(High) as MaxHigh min(Low) as MinLow by sno&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2014 13:03:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167798#M47788</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-07T13:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167799#M47789</link>
      <description>&lt;P&gt;1) work and I've reform 2) to index=yourIndexName sourcetype=yourSourceTypeName  | streamstats count as sno by Date | eval sno=if(sno&amp;lt;6,Date,null())| eventstats max(High) as MaxHigh min(Low) as MinLow by sno | table Date High Low sno MaxHigh MinLow&lt;/P&gt;

&lt;P&gt;For the last 3 fields, the search return the same row 5 times for each day as follow, &lt;BR /&gt;
sno=20140704 MaxHigh=197 MinLow=194&lt;BR /&gt;
sno=20140703 MaxHigh=197 MinLow=94&lt;BR /&gt;
sno=20140702 MaxHigh=84 MinLow=78&lt;BR /&gt;
sno=20140701 MaxHigh=97 MinLow=94&lt;/P&gt;

&lt;P&gt;I'll try to make up some data so can easily be seen how these value are from.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2014 03:13:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167799#M47789</guid>
      <dc:creator>calvintkng</dc:creator>
      <dc:date>2014-08-08T03:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167800#M47790</link>
      <description>&lt;P&gt;I noticed this is actually the MaxHigh and MinLow of the last 5 events of each day!  How to make it first 5 instead of last 5?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2014 09:32:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167800#M47790</guid>
      <dc:creator>calvintkng</dc:creator>
      <dc:date>2014-08-08T09:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167801#M47791</link>
      <description>&lt;P&gt;You can add a command "| reverse" before the streamstats to reverse the event list and it will pickup first 5. You can add another "| reverse" in the end if you want to final result to be shown in chronological (order before the first "|reverse" command).&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2014 13:42:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167801#M47791</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-08T13:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is this search achievable?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167802#M47792</link>
      <description>&lt;P&gt;Thanks somesoni2!  Using the search string below, I can get a list of events that is higher than the max high but not lower the the min low of the first 5 events every day.&lt;/P&gt;

&lt;P&gt;index=yourIndexName sourcetype=yourSourceTypeName | reverse |streamstats count as sno by Date | eval sno=if(sno&amp;lt;6,Date,null()) | eventstats max(High) as MaxHigh min(Low) as MinLow by sno| fillnull value=0 MaxHigh MinLow | eventstats max(MaxHigh) as MaxHigh max(MinLow) as MinLow by Date | where isnull(sno) AND High&amp;gt;MaxHigh AND Low&amp;gt;=MinLow&lt;/P&gt;</description>
      <pubDate>Mon, 11 Aug 2014 02:35:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-search-achievable/m-p/167802#M47792</guid>
      <dc:creator>calvintkng</dc:creator>
      <dc:date>2014-08-11T02:35:25Z</dc:date>
    </item>
  </channel>
</rss>

