<?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 read middle events from the event list? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-middle-events-from-the-event-list/m-p/375810#M162886</link>
    <description>&lt;P&gt;have you tried like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;base search giving events&amp;gt;|makemv _raw delim=" "
 |eval field3= mvindex(_raw,2), field4=mvindex(_raw,3)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What type of hard coding are you saying?&lt;/P&gt;</description>
    <pubDate>Thu, 15 Feb 2018 07:13:53 GMT</pubDate>
    <dc:creator>493669</dc:creator>
    <dc:date>2018-02-15T07:13:53Z</dc:date>
    <item>
      <title>How to read middle events from the event list?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-middle-events-from-the-event-list/m-p/375807#M162883</link>
      <description>&lt;P&gt;I am having n number of events but want to read 3 and 4th record.&lt;/P&gt;

&lt;P&gt;Eg:&lt;BR /&gt;
2018-02-09 ABCD 1234  5678&lt;BR /&gt;
2018-02-09 EFGH 1334  9978&lt;BR /&gt;
2018-02-08 ABCD 1234  6678&lt;BR /&gt;
2018-02-08 EFGH 1324  7778&lt;BR /&gt;
2018-02-07 ABCD 1254  5178&lt;BR /&gt;
2018-02-07 EFGH 1384  5978&lt;/P&gt;

&lt;P&gt;Out of the above kind of records I have to pick the 3rd and 4th event only.&lt;/P&gt;

&lt;P&gt;Head and Tail commands will give the first and last n number of events but how to pick middle/in-between events.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 06:51:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-middle-events-from-the-event-list/m-p/375807#M162883</guid>
      <dc:creator>Rajkumarkbm</dc:creator>
      <dc:date>2018-02-15T06:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to read middle events from the event list?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-middle-events-from-the-event-list/m-p/375808#M162884</link>
      <description>&lt;P&gt;Try this run anywhere search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults|eval _raw="2018-02-09 ABCD 1234 5678"
|append[|makeresults|eval _raw="2018-02-09 EFGH 1334 9978"]
|append[|makeresults|eval _raw="2018-02-08 ABCD 1234 6678"]
|append[|makeresults|eval _raw="2018-02-08 EFGH 1324 7778"]
|append[|makeresults|eval _raw="2018-02-07 ABCD 1254 5178"]
|append[|makeresults|eval _raw="2018-02-07 EFGH 1384 5978"]|makemv _raw delim=" "
|eval field3= mvindex(_raw,2), field4=mvindex(_raw,3)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Feb 2018 06:59:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-middle-events-from-the-event-list/m-p/375808#M162884</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-15T06:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to read middle events from the event list?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-middle-events-from-the-event-list/m-p/375809#M162885</link>
      <description>&lt;P&gt;If I am having n number of events this will not help and moreover there wont be any hard coded so is there any other way to access those events.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 07:06:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-middle-events-from-the-event-list/m-p/375809#M162885</guid>
      <dc:creator>Rajkumarkbm</dc:creator>
      <dc:date>2018-02-15T07:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to read middle events from the event list?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-middle-events-from-the-event-list/m-p/375810#M162886</link>
      <description>&lt;P&gt;have you tried like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;base search giving events&amp;gt;|makemv _raw delim=" "
 |eval field3= mvindex(_raw,2), field4=mvindex(_raw,3)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What type of hard coding are you saying?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 07:13:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-middle-events-from-the-event-list/m-p/375810#M162886</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-15T07:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to read middle events from the event list?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-middle-events-from-the-event-list/m-p/375811#M162887</link>
      <description>&lt;P&gt;Yes, I have tried this but it is not working as expected. I need to extract 3rd and 4th row or 5th and 6th row not the column.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 07:20:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-middle-events-from-the-event-list/m-p/375811#M162887</guid>
      <dc:creator>Rajkumarkbm</dc:creator>
      <dc:date>2018-02-15T07:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to read middle events from the event list?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-middle-events-from-the-event-list/m-p/375812#M162888</link>
      <description>&lt;P&gt;I do not know the standard of middle&lt;BR /&gt;
I think a little adjustment is necessary, but how about such a search sentence?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults        |eval Date="2018-02-09",Value1="ABCD",Value2="1234",Value3="5678"
 |append[|makeresults|eval Date="2018-02-09",Value1="EFGH",Value2="1334",Value3="9978"]
 |append[|makeresults|eval Date="2018-02-08",Value1="ABCD",Value2="1234",Value3="6678"]
 |append[|makeresults|eval Date="2018-02-08",Value1="EFGH",Value2="1324",Value3="7778"]
 |append[|makeresults|eval Date="2018-02-07",Value1="ABCD",Value2="1254",Value3="5178"]
 |append[|makeresults|eval Date="2018-02-07",Value1="EFGH",Value2="1384",Value3="5978"]
 |eval number=1| accum  number| eventstats max(number) as max,median(number) as median
 |eval Ref=floor(max/3)|where number&amp;gt;Ref and number&amp;lt;=median
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Feb 2018 08:21:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-middle-events-from-the-event-list/m-p/375812#M162888</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2018-02-15T08:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to read middle events from the event list?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-middle-events-from-the-event-list/m-p/375813#M162889</link>
      <description>&lt;P&gt;It's a tad clunky, but as long as you want to sort by _time, there's a way to do it with streamstats:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval low=3 
| eval high=4 
| streamstats count as NewToOld 
| head(NewToOld&amp;lt;=high) 
| reverse 
| streamstats count as OldToNew 
| head(OldToNew&amp;lt;=high-low+1) 
| reverse
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Streamstats will basically index your events for you and then through a little mathematical manipulation, you can use head and tail (or in this case, reverse &amp;amp; head) to chop off either end of the results leaving only the desired middle results. Note that this will only work if you're looking for the middle results by the order Splunk found them (which is the same as _time as long as you don't have any appended results).&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 15:55:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-middle-events-from-the-event-list/m-p/375813#M162889</guid>
      <dc:creator>LHAYNES020</dc:creator>
      <dc:date>2018-08-06T15:55:08Z</dc:date>
    </item>
  </channel>
</rss>

