<?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: Help with accessing the latest event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745151#M241371</link>
    <description>&lt;P&gt;You didn't answer&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;'s question about whether your sample is from an index or a lookup table. &amp;nbsp;I will assume that they come from events. &amp;nbsp;In this case, it is unnecessary to extract _time inline. &amp;nbsp;You can use latest as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;suggested, or you can simply use dedup to get the latest events before further processing:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval day = strftime(_time, "%F")
| dedup day Name&lt;/LI-CODE&gt;&lt;P&gt;Given this dataset&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Status&lt;/TD&gt;&lt;TD&gt;_raw&lt;/TD&gt;&lt;TD&gt;_time&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;TD&gt;ABC,F, 04/25/2025 15:50:00&lt;/TD&gt;&lt;TD&gt;2025-04-25 15:50:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;R&lt;/TD&gt;&lt;TD&gt;ABC,R, 04/25/2025 15:25:00&lt;/TD&gt;&lt;TD&gt;2025-04-25 15:25:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;TD&gt;ABC,F, 04/24/2025 15:30:03&lt;/TD&gt;&lt;TD&gt;2025-04-24 15:30:03&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;R&lt;/TD&gt;&lt;TD&gt;ABC,R, 04/24/2025 15:15:01&lt;/TD&gt;&lt;TD&gt;2025-04-24 15:15:01&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;The above will give you&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="42.3125px" height="25px"&gt;Name&lt;/TD&gt;&lt;TD width="40.5625px" height="25px"&gt;Status&lt;/TD&gt;&lt;TD width="218.671875px" height="25px"&gt;_raw&lt;/TD&gt;&lt;TD width="166.046875px" height="25px"&gt;_time&lt;/TD&gt;&lt;TD width="98.75px" height="25px"&gt;day&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="42.3125px" height="25px"&gt;ABC&lt;/TD&gt;&lt;TD width="40.5625px" height="25px"&gt;F&lt;/TD&gt;&lt;TD width="218.671875px" height="25px"&gt;ABC,F, 04/25/2025 15:50:00&lt;/TD&gt;&lt;TD width="166.046875px" height="25px"&gt;2025-04-25 15:50:00&lt;/TD&gt;&lt;TD width="98.75px" height="25px"&gt;2025-04-25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="42.3125px" height="25px"&gt;ABC&lt;/TD&gt;&lt;TD width="40.5625px" height="25px"&gt;F&lt;/TD&gt;&lt;TD width="218.671875px" height="25px"&gt;ABC,F, 04/24/2025 15:30:03&lt;/TD&gt;&lt;TD width="166.046875px" height="25px"&gt;2025-04-24 15:30:03&lt;/TD&gt;&lt;TD width="98.75px" height="25px"&gt;2025-04-24&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Here is a full emulation of your mock data&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="Name,Status,Datestamp
ABC,F, 04/24/2025 15:30:03
ABC,R, 04/24/2025 15:15:01
ABC,F, 04/25/2025 15:50:00
ABC,R, 04/25/2025 15:25:00"
| multikv forceheader=1
| eval _time = strptime(Datestamp, "%m/%d/%Y %T")
| fields - Datestamp linecount
| sort - _time
``` data emulation above ```&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 29 Apr 2025 06:26:23 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2025-04-29T06:26:23Z</dc:date>
    <item>
      <title>Help with accessing the latest event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745135#M241363</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have dataset in the following format&lt;/P&gt;&lt;P&gt;Name,Status,Timestamp&lt;/P&gt;&lt;P&gt;ABC,F,&amp;nbsp;&lt;SPAN&gt;04/24/2025 15:30:03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ABC, R, &lt;SPAN&gt;04/24/2025 15:15:01&lt;BR /&gt;&lt;BR /&gt;I need to be able to only display / render the latest status for a given name&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My output should like the following since the status as of&amp;nbsp;04/24/2025 15:30:03 is the most recent status.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ABC,F,&amp;nbsp;&lt;SPAN&gt;04/24/2025 15:30:03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Appreciate your help.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 01:29:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745135#M241363</guid>
      <dc:creator>bsreeram</dc:creator>
      <dc:date>2025-04-29T01:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help with accessing the latest event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745142#M241366</link>
      <description>&lt;P&gt;I am guessing this is data in a lookup file rather than event data - if you have event data you would already have a time stamp in the event which may or may not be the same as Timestamp.&lt;/P&gt;&lt;P&gt;However, in your specific example, assuming no _time field, the just parse the Timstamp field and use stats latest to get the latest, i.e.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="Name,Status,Timestamp
ABC,F, 04/24/2025 15:30:03
ABC, R, 04/24/2025 15:15:01"
| eval _time = strptime(Timestamp, "%m/%d/%Y %T")
| stats latest(*) as * by Name&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Apr 2025 04:01:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745142#M241366</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-04-29T04:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with accessing the latest event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745146#M241367</link>
      <description>&lt;P&gt;It worked for certain cases but please see the following&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the following data records,&lt;/P&gt;&lt;P&gt;ABC,F,&amp;nbsp;&lt;SPAN&gt;04/24/2025 15:30:03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ABC, R, &lt;SPAN&gt;04/24/2025 15:15:01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ABC,&amp;nbsp;F,&amp;nbsp;04/25/2025 15:50:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ABC, R, 04/25/2025 15:25:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution should be as follows - i.e. latest status by day has to be captured.&amp;nbsp;&lt;/P&gt;&lt;P&gt;ABC,F,&amp;nbsp;&lt;SPAN&gt;04/24/2025 15:30:03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ABC,&amp;nbsp;F,&amp;nbsp;04/25/2025 15:50:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 05:57:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745146#M241367</guid>
      <dc:creator>bsreeram</dc:creator>
      <dc:date>2025-04-29T05:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help with accessing the latest event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745148#M241368</link>
      <description>&lt;P&gt;It worked for certain cases but please see the following&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the following data records,&lt;/P&gt;&lt;P&gt;ABC,F,&amp;nbsp;&lt;SPAN&gt;04/24/2025 15:30:03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ABC, R, &lt;SPAN&gt;04/24/2025 15:15:01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ABC,&amp;nbsp;F,&amp;nbsp;04/25/2025 15:50:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ABC, R, 04/25/2025 15:25:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution should be as follows - i.e. latest status by day has to be captured.&amp;nbsp;&lt;/P&gt;&lt;P&gt;ABC,F,&amp;nbsp;&lt;SPAN&gt;04/24/2025 15:30:03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ABC,&amp;nbsp;F,&amp;nbsp;04/25/2025 15:50:00&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 05:59:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745148#M241368</guid>
      <dc:creator>bsreeram</dc:creator>
      <dc:date>2025-04-29T05:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help with accessing the latest event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745149#M241369</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/309666"&gt;@bsreeram&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want it splitting by Name and day so you get the latest per Name AND day then you can use a timechart&lt;/P&gt;&lt;P&gt;| timechart span=1d latest(*) as *&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt; &lt;STRONG&gt;Did this answer help you? If so, please consider&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 06:08:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745149#M241369</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-04-29T06:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help with accessing the latest event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745150#M241370</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="Name,Status,Timestamp
ABC,F, 04/24/2025 15:30:03
ABC, R, 04/24/2025 15:15:01
ABC, F, 04/25/2025 15:50:00
ABC, R, 04/25/2025 15:25:00"
| eval _time = strptime(Timestamp, "%m/%d/%Y %T")
| bin _time as _day span=1d
| stats latest(*) as * by _day Name&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Apr 2025 06:08:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745150#M241370</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-04-29T06:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help with accessing the latest event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745151#M241371</link>
      <description>&lt;P&gt;You didn't answer&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;'s question about whether your sample is from an index or a lookup table. &amp;nbsp;I will assume that they come from events. &amp;nbsp;In this case, it is unnecessary to extract _time inline. &amp;nbsp;You can use latest as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;suggested, or you can simply use dedup to get the latest events before further processing:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval day = strftime(_time, "%F")
| dedup day Name&lt;/LI-CODE&gt;&lt;P&gt;Given this dataset&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Status&lt;/TD&gt;&lt;TD&gt;_raw&lt;/TD&gt;&lt;TD&gt;_time&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;TD&gt;ABC,F, 04/25/2025 15:50:00&lt;/TD&gt;&lt;TD&gt;2025-04-25 15:50:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;R&lt;/TD&gt;&lt;TD&gt;ABC,R, 04/25/2025 15:25:00&lt;/TD&gt;&lt;TD&gt;2025-04-25 15:25:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;TD&gt;ABC,F, 04/24/2025 15:30:03&lt;/TD&gt;&lt;TD&gt;2025-04-24 15:30:03&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;R&lt;/TD&gt;&lt;TD&gt;ABC,R, 04/24/2025 15:15:01&lt;/TD&gt;&lt;TD&gt;2025-04-24 15:15:01&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;The above will give you&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="42.3125px" height="25px"&gt;Name&lt;/TD&gt;&lt;TD width="40.5625px" height="25px"&gt;Status&lt;/TD&gt;&lt;TD width="218.671875px" height="25px"&gt;_raw&lt;/TD&gt;&lt;TD width="166.046875px" height="25px"&gt;_time&lt;/TD&gt;&lt;TD width="98.75px" height="25px"&gt;day&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="42.3125px" height="25px"&gt;ABC&lt;/TD&gt;&lt;TD width="40.5625px" height="25px"&gt;F&lt;/TD&gt;&lt;TD width="218.671875px" height="25px"&gt;ABC,F, 04/25/2025 15:50:00&lt;/TD&gt;&lt;TD width="166.046875px" height="25px"&gt;2025-04-25 15:50:00&lt;/TD&gt;&lt;TD width="98.75px" height="25px"&gt;2025-04-25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="42.3125px" height="25px"&gt;ABC&lt;/TD&gt;&lt;TD width="40.5625px" height="25px"&gt;F&lt;/TD&gt;&lt;TD width="218.671875px" height="25px"&gt;ABC,F, 04/24/2025 15:30:03&lt;/TD&gt;&lt;TD width="166.046875px" height="25px"&gt;2025-04-24 15:30:03&lt;/TD&gt;&lt;TD width="98.75px" height="25px"&gt;2025-04-24&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Here is a full emulation of your mock data&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="Name,Status,Datestamp
ABC,F, 04/24/2025 15:30:03
ABC,R, 04/24/2025 15:15:01
ABC,F, 04/25/2025 15:50:00
ABC,R, 04/25/2025 15:25:00"
| multikv forceheader=1
| eval _time = strptime(Datestamp, "%m/%d/%Y %T")
| fields - Datestamp linecount
| sort - _time
``` data emulation above ```&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Apr 2025 06:26:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745151#M241371</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2025-04-29T06:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help with accessing the latest event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745154#M241372</link>
      <description>&lt;P&gt;I think you have your answer in other posts, but this is a good indication of asking the right question - including the "by day" also is an important point &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 06:42:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-accessing-the-latest-event/m-p/745154#M241372</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-04-29T06:42:14Z</dc:date>
    </item>
  </channel>
</rss>

