<?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 to get earliest datetime in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-earliest-datetime/m-p/327460#M166136</link>
    <description>&lt;P&gt;I have a field which contains first_found_date and due to some reason it keeps on changing for some of the assets.&lt;/P&gt;

&lt;P&gt;Example:&lt;BR /&gt;
If an asset "A1" has 3 first_found_date over a period of time:&lt;BR /&gt;
2017-06-20 22:30:30&lt;BR /&gt;
2016-05-25 22:30:30&lt;BR /&gt;
2017-01-25 22:30:30&lt;/P&gt;

&lt;P&gt;I want to use earliest first_found(i.e 2016-05-25 22:30:30) in all my reports.&lt;BR /&gt;
If I use the following query to check the earliest first_found , it takes more than 1 hour to get the value because it has to go through all the records over the period of time.&lt;/P&gt;

&lt;P&gt;sourcetype=a&lt;BR /&gt;
|eval combo = Asset+"_"+ID&lt;BR /&gt;
|stats min(FIRST_FOUND) as earliest_ff by combo&lt;/P&gt;

&lt;P&gt;Is there any way we can correlate the asset with its earliest first_found_date without editing props.conf?&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 15:41:23 GMT</pubDate>
    <dc:creator>poojak2579</dc:creator>
    <dc:date>2020-09-29T15:41:23Z</dc:date>
    <item>
      <title>How to get earliest datetime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-earliest-datetime/m-p/327460#M166136</link>
      <description>&lt;P&gt;I have a field which contains first_found_date and due to some reason it keeps on changing for some of the assets.&lt;/P&gt;

&lt;P&gt;Example:&lt;BR /&gt;
If an asset "A1" has 3 first_found_date over a period of time:&lt;BR /&gt;
2017-06-20 22:30:30&lt;BR /&gt;
2016-05-25 22:30:30&lt;BR /&gt;
2017-01-25 22:30:30&lt;/P&gt;

&lt;P&gt;I want to use earliest first_found(i.e 2016-05-25 22:30:30) in all my reports.&lt;BR /&gt;
If I use the following query to check the earliest first_found , it takes more than 1 hour to get the value because it has to go through all the records over the period of time.&lt;/P&gt;

&lt;P&gt;sourcetype=a&lt;BR /&gt;
|eval combo = Asset+"_"+ID&lt;BR /&gt;
|stats min(FIRST_FOUND) as earliest_ff by combo&lt;/P&gt;

&lt;P&gt;Is there any way we can correlate the asset with its earliest first_found_date without editing props.conf?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:41:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-earliest-datetime/m-p/327460#M166136</guid>
      <dc:creator>poojak2579</dc:creator>
      <dc:date>2020-09-29T15:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get earliest datetime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-earliest-datetime/m-p/327461#M166137</link>
      <description>&lt;P&gt;There are several ways.&lt;/P&gt;

&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=YouShouldAlwaysSpecifyAnIndex sourcetype=a
| stats earliest(FIRST_FOUND) AS earliest_ff BY Asset ID
| eval combo = Asset+"_"+ID
| table combo earliest_ff
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=YouShouldAlwaysSpecifyAnIndex sourcetype=a
| reverse
| dedup Asset ID
| eval combo = Asset+"_"+ID
| table combo FIRST_FOUND
| rename FIRST_FOUND AS earliest_ff
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 10 Sep 2017 08:30:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-earliest-datetime/m-p/327461#M166137</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-09-10T08:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get earliest datetime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-earliest-datetime/m-p/327462#M166138</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;BR /&gt;
I am already using the first code but it is taking long time to run the query because I have to check million of records with a time range of more than 1 year.&lt;BR /&gt;
I want to normalize it, assign the min(First_Found) to all  the combos at once and then use it everywhere.&lt;BR /&gt;
Please let me know if there is any other way to do it.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 21:15:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-earliest-datetime/m-p/327462#M166138</guid>
      <dc:creator>poojak2579</dc:creator>
      <dc:date>2017-09-12T21:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get earliest datetime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-earliest-datetime/m-p/327463#M166139</link>
      <description>&lt;P&gt;Let me make it more clear. There are vulnerabilities on the assets.&lt;BR /&gt;
ID is the Vulnerability Id and First_Found is the date when it was first found on the asset.&lt;BR /&gt;
 Because of some reason there are multiple First_Found for the combination of Asset+Id.&lt;BR /&gt;
I want to take earliest First_Found and assign it to the combination of Asset+Id.&lt;BR /&gt;
 I have scheduled a query to run everyday which will check Earliest First_Found in last one year and it takes long time to run.&lt;BR /&gt;
Is there any way we can assign min of First_Found to  Asset+Id so that I don't have to run that query over and over again?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:43:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-earliest-datetime/m-p/327463#M166139</guid>
      <dc:creator>poojak2579</dc:creator>
      <dc:date>2020-09-29T15:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get earliest datetime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-earliest-datetime/m-p/327464#M166140</link>
      <description>&lt;P&gt;You will have to make it an index-time field or create an accelerated data model so that you can use &lt;CODE&gt;tstats&lt;/CODE&gt;.  You might also use a &lt;CODE&gt;summary index&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 03:56:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-earliest-datetime/m-p/327464#M166140</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-09-13T03:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get earliest datetime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-earliest-datetime/m-p/327465#M166141</link>
      <description>&lt;P&gt;I tried accelerated Datamodel and summary index but it didn't work  because of some limitations .&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/556349/how-to-join-data-from-two-indexes.html"&gt;https://answers.splunk.com/answers/556349/how-to-join-data-from-two-indexes.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/569099/lookup-fields-not-updating-in-the-datamodel.html"&gt;https://answers.splunk.com/answers/569099/lookup-fields-not-updating-in-the-datamodel.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 15:24:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-earliest-datetime/m-p/327465#M166141</guid>
      <dc:creator>poojak2579</dc:creator>
      <dc:date>2017-09-13T15:24:12Z</dc:date>
    </item>
  </channel>
</rss>

