<?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 do you pull out the latest entry &amp;quot;only&amp;quot; for the last numbers entered? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-pull-out-the-latest-entry-quot-only-quot-for-the-last/m-p/382328#M68924</link>
    <description>&lt;P&gt;I have one file that is pulled in by a universal forwarder setup. &lt;/P&gt;

&lt;P&gt;This file is constantly changing on the system for which the file resides on, and the old data is never removed.  I don't want the search to display historical data for each item as I only want Splunk to poll this data for the current date and have this data displayed.  The file is a _json file with epoch time.  Currently I have my SPL search and the following: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest =-0d@d latest=now
|dedup customer
|eval trigger=strftime(last_number, "%T %F %Z")
|table customer number trigger
|rename trigger as Date_Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Would the above be accurate for me to attain only the results that I need?  I only want to display the latest from this imported _json file for each customer based off the last_number field.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 23:14:01 GMT</pubDate>
    <dc:creator>bzsplunk54</dc:creator>
    <dc:date>2020-09-29T23:14:01Z</dc:date>
    <item>
      <title>How do you pull out the latest entry "only" for the last numbers entered?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-pull-out-the-latest-entry-quot-only-quot-for-the-last/m-p/382328#M68924</link>
      <description>&lt;P&gt;I have one file that is pulled in by a universal forwarder setup. &lt;/P&gt;

&lt;P&gt;This file is constantly changing on the system for which the file resides on, and the old data is never removed.  I don't want the search to display historical data for each item as I only want Splunk to poll this data for the current date and have this data displayed.  The file is a _json file with epoch time.  Currently I have my SPL search and the following: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest =-0d@d latest=now
|dedup customer
|eval trigger=strftime(last_number, "%T %F %Z")
|table customer number trigger
|rename trigger as Date_Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Would the above be accurate for me to attain only the results that I need?  I only want to display the latest from this imported _json file for each customer based off the last_number field.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:14:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-pull-out-the-latest-entry-quot-only-quot-for-the-last/m-p/382328#M68924</guid>
      <dc:creator>bzsplunk54</dc:creator>
      <dc:date>2020-09-29T23:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do you pull out the latest entry "only" for the last numbers entered?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-pull-out-the-latest-entry-quot-only-quot-for-the-last/m-p/382329#M68925</link>
      <description>&lt;P&gt;The &lt;CODE&gt;stats latest(FIELD) as FIELD&lt;/CODE&gt; command is going to be the best way to do this. &lt;/P&gt;

&lt;P&gt;Your current query may fail if you run it very early in the morning at as 12:05 am.&lt;/P&gt;

&lt;P&gt;Better to do something like &lt;CODE&gt;SEARCH | stats latest(last_numer) as last_number&lt;/CODE&gt; or even SEARCH | stats latest(*) as *`  This will return the most recent of all fields.&lt;/P&gt;

&lt;P&gt;Note that if you fields in the event change you might need some extra tricks that I can help you with.&lt;/P&gt;

&lt;P&gt;All the best&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 23:29:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-pull-out-the-latest-entry-quot-only-quot-for-the-last/m-p/382329#M68925</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-02-13T23:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do you pull out the latest entry "only" for the last numbers entered?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-pull-out-the-latest-entry-quot-only-quot-for-the-last/m-p/382330#M68926</link>
      <description>&lt;P&gt;That should be fine if &lt;CODE&gt;last_number&lt;/CODE&gt; was used for &lt;CODE&gt;_time&lt;/CODE&gt;.  If not, you need this (and probably a wider/longer time span for &lt;CODE&gt;earliest&lt;/CODE&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest =-0d@d latest=now
| sort 0 - last_number
| dedup customer
| eval Date_Time=strftime(last_number, "%T %F %Z")
| table customer number Date_Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Feb 2019 00:46:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-pull-out-the-latest-entry-quot-only-quot-for-the-last/m-p/382330#M68926</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-14T00:46:58Z</dc:date>
    </item>
  </channel>
</rss>

