<?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: Alphabetically sorting a MVfield in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Alphabetically-sorting-a-MVfield/m-p/505199#M141175</link>
    <description>&lt;P&gt;It's not clear what results you want.&amp;nbsp; Can you provide a mockup of the desired output?&lt;/P&gt;&lt;P&gt;Have you tried putting both columns in the stats command?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats values(*) as * by idnumber&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 19 Jun 2020 14:20:59 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-06-19T14:20:59Z</dc:date>
    <item>
      <title>Alphabetically sorting a MVfield</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alphabetically-sorting-a-MVfield/m-p/505182#M141168</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I'm trying to combine a number of fields using:&lt;/P&gt;&lt;P&gt;| stats values(task_name) as task_name by idnumber&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This works great when it comes to timestamps associated with the idnumber, but for&lt;BR /&gt;the tasks associated with it, splunk sorts it alphabetically.&lt;/P&gt;&lt;P&gt;This leads to problems down the line when we try to see which task was executed first.&lt;/P&gt;&lt;P&gt;Part of the problem is that the number of timestamps can differ from the number of tasks&lt;BR /&gt;so to make a new field with timestamp and task combined does not work.&lt;/P&gt;&lt;P&gt;#original data:&lt;BR /&gt;sysmodtime,task_name,idnumber&lt;BR /&gt;05/01/20 12:00 PM,one,1&lt;BR /&gt;05/01/20 12:01 AM,two,1&lt;BR /&gt;05/01/20 12:02 AM,two,1&lt;BR /&gt;05/01/20 12:02 AM,two,1&lt;BR /&gt;05/02/20 12:00 PM,one,2&lt;BR /&gt;04/02/20 12:00 AM,one,2&lt;BR /&gt;04/02/20 01:00 AM,one,2&lt;BR /&gt;04/02/20 02:00 AM,one,3&lt;BR /&gt;05/04/20 12:00 PM,one,4&lt;BR /&gt;05/03/20 12:00 PM,two,4&lt;BR /&gt;05/03/20 12:01 PM,three,4&lt;BR /&gt;05/03/20 12:02 PM,four,4&lt;BR /&gt;05/03/20 12:40 PM,five,4&lt;BR /&gt;05/03/20 12:50 PM,six,4&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#the conflicting results after stats command (see attachment)&lt;/P&gt;&lt;P&gt;Any advice would be welcome&lt;BR /&gt;Cheers,&lt;BR /&gt;Roelof&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2020 12:43:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alphabetically-sorting-a-MVfield/m-p/505182#M141168</guid>
      <dc:creator>rvsroe</dc:creator>
      <dc:date>2020-06-19T12:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetically sorting a MVfield</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alphabetically-sorting-a-MVfield/m-p/505199#M141175</link>
      <description>&lt;P&gt;It's not clear what results you want.&amp;nbsp; Can you provide a mockup of the desired output?&lt;/P&gt;&lt;P&gt;Have you tried putting both columns in the stats command?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats values(*) as * by idnumber&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 19 Jun 2020 14:20:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alphabetically-sorting-a-MVfield/m-p/505199#M141175</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-06-19T14:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetically sorting a MVfield</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alphabetically-sorting-a-MVfield/m-p/505442#M141246</link>
      <description>&lt;P&gt;Hi Richgalloway, thanks for the reply, the atachment in the main question shows the erroneous results, with the tasks sorted alphabetically instead of matched with the timestamp, so for example for id number 1 there are 6 tasks and 6 time stamps,&amp;nbsp; the stats command (placing both columns inside stats) gives:&lt;/P&gt;&lt;P&gt;sysmodtime, task_name, idnumber&lt;BR /&gt;05/04/20 12:00 PM, five, 4&lt;BR /&gt;05/03/20 12:00 PM, four,&lt;BR /&gt;05/03/20 12:01 PM, one,&lt;BR /&gt;05/03/20 12:02 PM, six.&lt;BR /&gt;05/03/20 12:40 PM, three,&lt;BR /&gt;05/03/20 12:50 PM, two,&lt;/P&gt;&lt;P&gt;whereas the order should be simply; one, two, three, four, five, six&lt;/P&gt;&lt;P&gt;Solutions that make a new field using sysmodtime and task_name fail since number of tasks&lt;BR /&gt;and number of sysmodtime are not equal in all cases.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 08:45:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alphabetically-sorting-a-MVfield/m-p/505442#M141246</guid>
      <dc:creator>rvsroe</dc:creator>
      <dc:date>2020-06-22T08:45:29Z</dc:date>
    </item>
  </channel>
</rss>

