<?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 create a table of latest event when events have same timestamp? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-of-latest-event-when-events-have-same/m-p/597626#M208078</link>
    <description>&lt;P&gt;Hello Splunkers - I am struggling to create a table that shows distinct events that sometimes have the same timestamp:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="12.5%" height="25px"&gt;_time&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;vulnerability&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;asset&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;ipAddress&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;vendor&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;cvssScore&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;lastFound&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;supportContact&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="12.5%" height="69px"&gt;&lt;SPAN&gt;2022-05-12 05:23:24&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;&lt;FONT color="#000000"&gt;CVE-2022-1234&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;host1&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;ip1&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;vendor1&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;score1&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;2022-05-12&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;support1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="12.5%" height="69px"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;2022-05-12 05:23:24&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;&lt;FONT color="#000000"&gt;CVE-2021-5678&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;host2&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;ip2&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;vendor2&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;score2&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;2022-05-12&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;support2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;2022-05-12 05:23:24&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT color="#000000"&gt;CVE-2016-1234&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD&gt;host3&lt;/TD&gt;
&lt;TD&gt;ip3&lt;/TD&gt;
&lt;TD&gt;vendor3&lt;/TD&gt;
&lt;TD&gt;score3&lt;/TD&gt;
&lt;TD&gt;2022-05-12&lt;/TD&gt;
&lt;TD&gt;support3&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't find the right way to search these events so that all distinct events show. Based on one of the many answers I read here, I've tried using eventstats, but it's not working as I'd hoped. Here's the query:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| eventstats latest(_time) as lastFound | where lastFound=_time&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| table _time, vulnerability, asset, ipAddress, vendor, cvssScore, lastFound, supportContact&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;When I run this I get a table with the latest events by _time, but it does not take into account that there are different values in the other fields. So instead of the 5,000 events I'm expecting, I get a few hundred.&lt;/P&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="12.5%"&gt;_time&lt;/TD&gt;
&lt;TD width="12.5%"&gt;vulnerability&lt;/TD&gt;
&lt;TD width="12.5%"&gt;asset&lt;/TD&gt;
&lt;TD width="12.5%"&gt;ipAddress&lt;/TD&gt;
&lt;TD width="12.5%"&gt;vendor&lt;/TD&gt;
&lt;TD width="12.5%"&gt;cvssScore&lt;/TD&gt;
&lt;TD width="12.5%"&gt;lastFound&lt;/TD&gt;
&lt;TD width="12.5%"&gt;supportContact&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="12.5%"&gt;&lt;SPAN&gt;2022-05-12 05:23:24&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="12.5%"&gt;CVE-2022-1234&lt;/TD&gt;
&lt;TD width="12.5%"&gt;host1&lt;/TD&gt;
&lt;TD width="12.5%"&gt;ip1&lt;/TD&gt;
&lt;TD width="12.5%"&gt;vendor1&lt;/TD&gt;
&lt;TD width="12.5%"&gt;score1&lt;/TD&gt;
&lt;TD width="12.5%"&gt;lastFoundTime&lt;/TD&gt;
&lt;TD width="12.5%"&gt;support1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
    <pubDate>Thu, 12 May 2022 16:31:12 GMT</pubDate>
    <dc:creator>mistydennis</dc:creator>
    <dc:date>2022-05-12T16:31:12Z</dc:date>
    <item>
      <title>How to create a table of latest event when events have same timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-of-latest-event-when-events-have-same/m-p/597626#M208078</link>
      <description>&lt;P&gt;Hello Splunkers - I am struggling to create a table that shows distinct events that sometimes have the same timestamp:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="12.5%" height="25px"&gt;_time&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;vulnerability&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;asset&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;ipAddress&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;vendor&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;cvssScore&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;lastFound&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;supportContact&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="12.5%" height="69px"&gt;&lt;SPAN&gt;2022-05-12 05:23:24&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;&lt;FONT color="#000000"&gt;CVE-2022-1234&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;host1&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;ip1&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;vendor1&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;score1&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;2022-05-12&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;support1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="12.5%" height="69px"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;2022-05-12 05:23:24&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;&lt;FONT color="#000000"&gt;CVE-2021-5678&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;host2&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;ip2&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;vendor2&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;score2&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;2022-05-12&lt;/TD&gt;
&lt;TD width="12.5%" height="69px"&gt;support2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;2022-05-12 05:23:24&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT color="#000000"&gt;CVE-2016-1234&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD&gt;host3&lt;/TD&gt;
&lt;TD&gt;ip3&lt;/TD&gt;
&lt;TD&gt;vendor3&lt;/TD&gt;
&lt;TD&gt;score3&lt;/TD&gt;
&lt;TD&gt;2022-05-12&lt;/TD&gt;
&lt;TD&gt;support3&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't find the right way to search these events so that all distinct events show. Based on one of the many answers I read here, I've tried using eventstats, but it's not working as I'd hoped. Here's the query:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| eventstats latest(_time) as lastFound | where lastFound=_time&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| table _time, vulnerability, asset, ipAddress, vendor, cvssScore, lastFound, supportContact&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;When I run this I get a table with the latest events by _time, but it does not take into account that there are different values in the other fields. So instead of the 5,000 events I'm expecting, I get a few hundred.&lt;/P&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="12.5%"&gt;_time&lt;/TD&gt;
&lt;TD width="12.5%"&gt;vulnerability&lt;/TD&gt;
&lt;TD width="12.5%"&gt;asset&lt;/TD&gt;
&lt;TD width="12.5%"&gt;ipAddress&lt;/TD&gt;
&lt;TD width="12.5%"&gt;vendor&lt;/TD&gt;
&lt;TD width="12.5%"&gt;cvssScore&lt;/TD&gt;
&lt;TD width="12.5%"&gt;lastFound&lt;/TD&gt;
&lt;TD width="12.5%"&gt;supportContact&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="12.5%"&gt;&lt;SPAN&gt;2022-05-12 05:23:24&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="12.5%"&gt;CVE-2022-1234&lt;/TD&gt;
&lt;TD width="12.5%"&gt;host1&lt;/TD&gt;
&lt;TD width="12.5%"&gt;ip1&lt;/TD&gt;
&lt;TD width="12.5%"&gt;vendor1&lt;/TD&gt;
&lt;TD width="12.5%"&gt;score1&lt;/TD&gt;
&lt;TD width="12.5%"&gt;lastFoundTime&lt;/TD&gt;
&lt;TD width="12.5%"&gt;support1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 16:31:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-of-latest-event-when-events-have-same/m-p/597626#M208078</guid>
      <dc:creator>mistydennis</dc:creator>
      <dc:date>2022-05-12T16:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Table latest event when events have same timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-of-latest-event-when-events-have-same/m-p/597639#M208084</link>
      <description>&lt;P&gt;Your eventstats is not taking the different values of the fields into account&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats latest(_time) as lastFound by vulnerability, asset, ipAddress, vendor, cvssScore, supportContact
| where lastFound=_time
| table _time, vulnerability, asset, ipAddress, vendor, cvssScore, lastFound, supportContact&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 12 May 2022 16:30:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-of-latest-event-when-events-have-same/m-p/597639#M208084</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-12T16:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table of latest event when events have same timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-of-latest-event-when-events-have-same/m-p/597673#M208094</link>
      <description>&lt;P&gt;That did the trick! I had a feeling I was missing something basic, thank you very much!&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can you tell me the difference between using eventstats latest vs. stats latest in this particular case? I can see that it adjusts the number of events I receive, but I'm not sure &lt;EM&gt;why&lt;/EM&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 18:31:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-of-latest-event-when-events-have-same/m-p/597673#M208094</guid>
      <dc:creator>mistydennis</dc:creator>
      <dc:date>2022-05-12T18:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table of latest event when events have same timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-of-latest-event-when-events-have-same/m-p/597674#M208095</link>
      <description>&lt;P&gt;Eventstats will add fields to the events in the pipeline without removing any events - stats will replace all the events in the pipeline with events with the aggregated values.&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 18:34:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-of-latest-event-when-events-have-same/m-p/597674#M208095</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-12T18:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table of latest event when events have same timestamp?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-of-latest-event-when-events-have-same/m-p/597675#M208096</link>
      <description>&lt;P&gt;Makes sense, thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 18:36:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-of-latest-event-when-events-have-same/m-p/597675#M208096</guid>
      <dc:creator>mistydennis</dc:creator>
      <dc:date>2022-05-12T18:36:43Z</dc:date>
    </item>
  </channel>
</rss>

