<?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: Why does latest does not work with multivalues properly? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-does-latest-does-not-work-with-multivalues-properly/m-p/671085#M229991</link>
    <description>&lt;P&gt;That's actually a good (and working) idea! Thank you very much! I don't know why latest didn't work either cause technically it should just check with the time and return the whole thing, right?&lt;BR /&gt;&lt;BR /&gt;But yes, it works now, thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Dec 2023 21:38:45 GMT</pubDate>
    <dc:creator>MirrorCraze</dc:creator>
    <dc:date>2023-12-06T21:38:45Z</dc:date>
    <item>
      <title>Why does latest does not work with multivalues properly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-latest-does-not-work-with-multivalues-properly/m-p/671081#M229987</link>
      <description>&lt;P&gt;I have some search before, and after I extract fields (name, status) from json and mvzip it together, I got this table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="40px"&gt;_time&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="40px"&gt;name&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="40px"&gt;status&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="40px"&gt;nameStatus&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="113px"&gt;&lt;SPAN&gt;2023-12-06 16:06:20&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="113px"&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="113px"&gt;&lt;P&gt;UP&lt;/P&gt;&lt;P&gt;DOWN&lt;/P&gt;&lt;P&gt;UP&lt;/P&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="113px"&gt;&lt;P&gt;A,UP&lt;/P&gt;&lt;P&gt;B,DOWN&lt;/P&gt;&lt;P&gt;C,UP&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="113px"&gt;&lt;SPAN&gt;2023-12-06 16:03:20&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="113px"&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="113px"&gt;&lt;P&gt;UP&lt;/P&gt;&lt;P&gt;UP&lt;/P&gt;&lt;P&gt;UP&lt;/P&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="113px"&gt;&lt;P&gt;A,UP&lt;/P&gt;&lt;P&gt;B,UP&lt;/P&gt;&lt;P&gt;C,UP&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="113px"&gt;&lt;SPAN&gt;2023-12-06 16:00:20&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="113px"&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="113px"&gt;&lt;P&gt;DOWN&amp;nbsp;&lt;/P&gt;&lt;P&gt;UP&lt;/P&gt;&lt;P&gt;UP&lt;/P&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="113px"&gt;&lt;P&gt;A,DOWN&lt;/P&gt;&lt;P&gt;B,UP&lt;/P&gt;&lt;P&gt;C,UP&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get only the latest time of the records, so I pipe in the command&amp;nbsp; ...|stats latest(nameStatus). However, the result comes out only as&lt;/P&gt;&lt;P&gt;A,UP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I fix this? Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 21:15:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-latest-does-not-work-with-multivalues-properly/m-p/671081#M229987</guid>
      <dc:creator>MirrorCraze</dc:creator>
      <dc:date>2023-12-06T21:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Why does latest does not work with multivalues properly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-latest-does-not-work-with-multivalues-properly/m-p/671083#M229989</link>
      <description>&lt;P&gt;That's interesting and seems as thought it may be a bug, but it may be that it's always worked that way.&lt;/P&gt;&lt;P&gt;The solution is to mvjoin the data so it's single value then split it afterwards, e.g.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| eval nameStatus=mvjoin(nameStatus,"##")
| stats latest(nameStatus) as nameStatus
| eval nameStatus=split(nameStatus, "##")&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Dec 2023 21:27:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-latest-does-not-work-with-multivalues-properly/m-p/671083#M229989</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-12-06T21:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why does latest does not work with multivalues properly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-latest-does-not-work-with-multivalues-properly/m-p/671085#M229991</link>
      <description>&lt;P&gt;That's actually a good (and working) idea! Thank you very much! I don't know why latest didn't work either cause technically it should just check with the time and return the whole thing, right?&lt;BR /&gt;&lt;BR /&gt;But yes, it works now, thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 21:38:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-latest-does-not-work-with-multivalues-properly/m-p/671085#M229991</guid>
      <dc:creator>MirrorCraze</dc:creator>
      <dc:date>2023-12-06T21:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why does latest does not work with multivalues properly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-latest-does-not-work-with-multivalues-properly/m-p/671088#M229994</link>
      <description>&lt;P&gt;I agree, that you would expect it to return the entire MV field, not just the first value.&lt;/P&gt;&lt;P&gt;I suspect this may be a bug that has existed forever, but one which has a workaround.&lt;/P&gt;&lt;P&gt;If you have a support entitlement with Splunk, you could raise that as a bug and see what they say&lt;/P&gt;&lt;P&gt;This is a simple working example from your data that exhibits the problem&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="_time,name,status,nameStatus
2023-12-06 16:06:20,A:B:C,UP:DOWN:UP,A;UP:B;DOWN:C;UP
2023-12-06 16:03:20,A:B:C,UP:UP:UP,A;UP:B;UP:C;UP
2023-12-06 16:00:20,A:B:C,DOWN:UP:UP,A;DOWN:B;UP:C;UP"
| foreach * [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=split(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, ":") ]
```| eval nameStatus=mvjoin(nameStatus,"##")```
| stats latest(nameStatus) as nameStatus
```| eval nameStatus=split(nameStatus, "##")```&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Dec 2023 21:43:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-latest-does-not-work-with-multivalues-properly/m-p/671088#M229994</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-12-06T21:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why does latest does not work with multivalues properly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-latest-does-not-work-with-multivalues-properly/m-p/671119#M230005</link>
      <description>&lt;P&gt;We talked about it with &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt; on Slack and it seems the behaviour is intentional and is docummented (albeit a bit vaguely) - "Use the event order functions to return values from fields based on the order in which the event is processed, which is not necessarily chronological or timestamp order. " (from &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Eventorderfunctions" target="_self"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Eventorderfunctions&lt;/A&gt; )&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 08:05:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-latest-does-not-work-with-multivalues-properly/m-p/671119#M230005</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-12-07T08:05:18Z</dc:date>
    </item>
  </channel>
</rss>

