<?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: fetch between 2000 to 3000 events in query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/fetch-between-2000-to-3000-events-in-query/m-p/264693#M176871</link>
    <description>&lt;P&gt;This is another option&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex sourcetype=mysourcetype | streamstats count | where count&amp;gt;=2000 AND count&amp;lt;=3000 | fields - count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 02 Sep 2016 13:52:55 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-09-02T13:52:55Z</dc:date>
    <item>
      <title>fetch between 2000 to 3000 events in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fetch-between-2000-to-3000-events-in-query/m-p/264690#M176868</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;In splunk query 'head' command is used to get the first 'particular' number of events. I want to get the events between the specified numbers. My query should be something like index=myindex sourcetype=mysorcetype | head (2000 to 3000) &lt;BR /&gt;
Is there any command to get the events range?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 11:31:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fetch-between-2000-to-3000-events-in-query/m-p/264690#M176868</guid>
      <dc:creator>pasokkum</dc:creator>
      <dc:date>2016-09-02T11:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: fetch between 2000 to 3000 events in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fetch-between-2000-to-3000-events-in-query/m-p/264691#M176869</link>
      <description>&lt;P&gt;I don't think so but could be wrong. An option that comes to mind, though not particularly elegant, is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex sourcetype=mysourcetype | head 3000 | tail 1000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here you'd get the top 3k and then with the tail command get the bottom 1k&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 11:39:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fetch-between-2000-to-3000-events-in-query/m-p/264691#M176869</guid>
      <dc:creator>Runals</dc:creator>
      <dc:date>2016-09-02T11:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: fetch between 2000 to 3000 events in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fetch-between-2000-to-3000-events-in-query/m-p/264692#M176870</link>
      <description>&lt;P&gt;Thanks Runals..! | head 3000 | tail 1000 is taking more time to load the results results when compared to | head 1000..  &lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 13:43:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fetch-between-2000-to-3000-events-in-query/m-p/264692#M176870</guid>
      <dc:creator>pasokkum</dc:creator>
      <dc:date>2016-09-02T13:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: fetch between 2000 to 3000 events in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fetch-between-2000-to-3000-events-in-query/m-p/264693#M176871</link>
      <description>&lt;P&gt;This is another option&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex sourcetype=mysourcetype | streamstats count | where count&amp;gt;=2000 AND count&amp;lt;=3000 | fields - count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Sep 2016 13:52:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fetch-between-2000-to-3000-events-in-query/m-p/264693#M176871</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-02T13:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: fetch between 2000 to 3000 events in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fetch-between-2000-to-3000-events-in-query/m-p/264694#M176872</link>
      <description>&lt;P&gt;yeah I'm guessing tail will result in longer times as Splunk has to read 'through' all of the events to get to the bottom/end of the result set (highly technical description there). A somewhat more inelegant but potentially faster solution might be&lt;/P&gt;

&lt;P&gt;... | head 300 | reverse | head 1000 | reverse&lt;/P&gt;

&lt;P&gt;the point of the numbers though was to get to items number 2k through 3k from your original request. In my environment I did a search on Windows Security Event Viewer logs from a very large index (tens of millions of Windows audit logs). The head / tail solution took 4.9s. The head/reverse/head/reverse method took 2.9s /shrug.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 13:55:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fetch-between-2000-to-3000-events-in-query/m-p/264694#M176872</guid>
      <dc:creator>Runals</dc:creator>
      <dc:date>2016-09-02T13:55:18Z</dc:date>
    </item>
  </channel>
</rss>

