<?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 can I get the 10 oldest events of a search first and quickly? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-10-oldest-events-of-a-search-first-and-quickly/m-p/325001#M96936</link>
    <description>&lt;P&gt;All, &lt;/P&gt;

&lt;P&gt;Any idea how I get the 10 oldest events from the search below? I need it to validate that we have 90 days of retention for an audit. Seems like I should be able to go a head 10. Seems to be there should be a faster way of doing this rather than just using the head/tail functions?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* host=*dcs* sourcetype="WinEventLog:Security"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 24 Feb 2017 17:35:07 GMT</pubDate>
    <dc:creator>daniel333</dc:creator>
    <dc:date>2017-02-24T17:35:07Z</dc:date>
    <item>
      <title>How can I get the 10 oldest events of a search first and quickly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-10-oldest-events-of-a-search-first-and-quickly/m-p/325001#M96936</link>
      <description>&lt;P&gt;All, &lt;/P&gt;

&lt;P&gt;Any idea how I get the 10 oldest events from the search below? I need it to validate that we have 90 days of retention for an audit. Seems like I should be able to go a head 10. Seems to be there should be a faster way of doing this rather than just using the head/tail functions?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* host=*dcs* sourcetype="WinEventLog:Security"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Feb 2017 17:35:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-10-oldest-events-of-a-search-first-and-quickly/m-p/325001#M96936</guid>
      <dc:creator>daniel333</dc:creator>
      <dc:date>2017-02-24T17:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the 10 oldest events of a search first and quickly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-10-oldest-events-of-a-search-first-and-quickly/m-p/325002#M96937</link>
      <description>&lt;P&gt;Hi daniel333, &lt;CODE&gt;tstats&lt;/CODE&gt; looks like a good use here. For instance:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats min(_time) as earliestTime where index=* host=*dcs* sourcetype="WinEventLog:Security" | convert ctime(earliestTime)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Run it over 90 or more days to get the minimum value for the events that match that search.&lt;/P&gt;

&lt;P&gt;You could get a more informative look on retention by splitting by host, for instance:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    | tstats min(_time) as earliestTime where index=* host=*dcs* sourcetype="WinEventLog:Security" by host | convert ctime(earliestTime)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To get the raw events themselves, I'd just use a custom search time that has a narrow window, like &lt;CODE&gt;earliest=-90d@d latest=-89d@d&lt;/CODE&gt; to make the search run faster&lt;/P&gt;

&lt;P&gt;Please let me know if this answers your question! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 17:49:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-10-oldest-events-of-a-search-first-and-quickly/m-p/325002#M96937</guid>
      <dc:creator>muebel</dc:creator>
      <dc:date>2017-02-24T17:49:35Z</dc:date>
    </item>
  </channel>
</rss>

