<?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 find earliest event based on Event code for once server? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-earliest-event-based-on-Event-code-for-once-server/m-p/37307#M8324</link>
    <description>&lt;P&gt;Thanks cphair for your reply but when I run this i get this error:&lt;/P&gt;

&lt;P&gt;Error in 'stats' command: The argument 'earliest(_time)' is invalid.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Apr 2012 02:05:27 GMT</pubDate>
    <dc:creator>singhg</dc:creator>
    <dc:date>2012-04-27T02:05:27Z</dc:date>
    <item>
      <title>How to find earliest event based on Event code for once server?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-earliest-event-based-on-Event-code-for-once-server/m-p/37305#M8322</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trging to find the first time the event ID 4656 was indexed for particular server.&lt;/P&gt;

&lt;P&gt;the below search gives me only the first time any event was indexed for this server:&lt;BR /&gt;
| metadata index=main type=hosts | search host="Name" | fields + host, firstTime | convert ctime(firstTime)&lt;/P&gt;

&lt;P&gt;Do you know a command to do that?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2012 16:39:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-earliest-event-based-on-Event-code-for-once-server/m-p/37305#M8322</guid>
      <dc:creator>singhg</dc:creator>
      <dc:date>2012-04-26T16:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to find earliest event based on Event code for once server?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-earliest-event-based-on-Event-code-for-once-server/m-p/37306#M8323</link>
      <description>&lt;P&gt;For a known host foo:&lt;/P&gt;

&lt;P&gt;index=main EventCode=4656 host=foo | stats earliest(_time) as Earliest | eval FirstSeen=strftime(Earliest,"%+") | table FirstSeen&lt;/P&gt;

&lt;P&gt;To find the first time the event occurred on each host in the index:&lt;/P&gt;

&lt;P&gt;index=main EventCode=4656 | stats earliest(_time) as Earliest by host | eval FirstSeen=strftime(Earliest,"%+") | table host,FirstSeen&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2012 17:27:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-earliest-event-based-on-Event-code-for-once-server/m-p/37306#M8323</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2012-04-26T17:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to find earliest event based on Event code for once server?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-earliest-event-based-on-Event-code-for-once-server/m-p/37307#M8324</link>
      <description>&lt;P&gt;Thanks cphair for your reply but when I run this i get this error:&lt;/P&gt;

&lt;P&gt;Error in 'stats' command: The argument 'earliest(_time)' is invalid.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2012 02:05:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-earliest-event-based-on-Event-code-for-once-server/m-p/37307#M8324</guid>
      <dc:creator>singhg</dc:creator>
      <dc:date>2012-04-27T02:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to find earliest event based on Event code for once server?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-earliest-event-based-on-Event-code-for-once-server/m-p/37308#M8325</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/71719"&gt;@singhg&lt;/a&gt;, are you on an earlier version of Splunk?  It looks like the earliest function was introduced in 4.3.  You can try last(_time) instead of earliest(_time), which looks at the time the event was indexed rather than the actual timestamp and so may be a bit less accurate.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:44:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-earliest-event-based-on-Event-code-for-once-server/m-p/37308#M8325</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2020-09-28T11:44:45Z</dc:date>
    </item>
  </channel>
</rss>

