<?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 Help With Sorting - Multiple Decimal Points in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-With-Sorting-Multiple-Decimal-Points/m-p/314797#M94211</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm dealing with decimal points trying to determine the latest version of some software, but it's botching the integers after the first decimal point.&lt;/P&gt;

&lt;P&gt;SoftwareVersion&lt;BR /&gt;
5.0.1450.509&lt;BR /&gt;
5.0.1450.8 &amp;lt;----Example&lt;BR /&gt;
4.2.1330.31&lt;/P&gt;

&lt;P&gt;I've tried stats list(field) and it still didn't provide the searching I was looking for. Thoughts? Please don't suggest an eval field separation per decimal &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Feb 2018 05:38:23 GMT</pubDate>
    <dc:creator>bgagliardi1</dc:creator>
    <dc:date>2018-02-28T05:38:23Z</dc:date>
    <item>
      <title>Help With Sorting - Multiple Decimal Points</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-With-Sorting-Multiple-Decimal-Points/m-p/314797#M94211</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm dealing with decimal points trying to determine the latest version of some software, but it's botching the integers after the first decimal point.&lt;/P&gt;

&lt;P&gt;SoftwareVersion&lt;BR /&gt;
5.0.1450.509&lt;BR /&gt;
5.0.1450.8 &amp;lt;----Example&lt;BR /&gt;
4.2.1330.31&lt;/P&gt;

&lt;P&gt;I've tried stats list(field) and it still didn't provide the searching I was looking for. Thoughts? Please don't suggest an eval field separation per decimal &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 05:38:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-With-Sorting-Multiple-Decimal-Points/m-p/314797#M94211</guid>
      <dc:creator>bgagliardi1</dc:creator>
      <dc:date>2018-02-28T05:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help With Sorting - Multiple Decimal Points</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-With-Sorting-Multiple-Decimal-Points/m-p/314798#M94212</link>
      <description>&lt;P&gt;Assuming all of your version strings are the same number of components long, I would try the &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/SearchReference/sort"&gt;sort&lt;/A&gt; command, specifically telling it to sort the field as an IP address: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| sort ip(SoftwareVersion)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It seems to work well so long as all the versions are the same length: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval versions=split("5.0.13.1,5.0.1450.509,4.2.1330.31,5.0.1450.510,5.0.1449.508,5.0.15.4",",") | mvexpand versions | sort ip(versions)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But it seems to get tripped up when the version strings are varying numbers of components long:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval versions=split("5.0.13.1,5.0.1450.509.1,4.2.1330.31,5.0.1450.510,5.0.1449.508,5.0.15",",") | mvexpand versions | sort ip(versions)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would then also file a P4 enhancement request asking for an additional sort option (possibly one based on semantic versioning).&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 06:10:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-With-Sorting-Multiple-Decimal-Points/m-p/314798#M94212</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2018-02-28T06:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help With Sorting - Multiple Decimal Points</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-With-Sorting-Multiple-Decimal-Points/m-p/314799#M94213</link>
      <description>&lt;P&gt;Thanks, I'll submit the P4 enhancement.  Fortunately, I realized that the delineation between numbering orders was operating system based, OSX/Windows clients. I was able to do the sort correctly by running two searches specific to the OS', and then sorting that way.&lt;/P&gt;

&lt;P&gt;I can confirm it was lexicographical ordering vs semantic versioning.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 21:01:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-With-Sorting-Multiple-Decimal-Points/m-p/314799#M94213</guid>
      <dc:creator>bgagliardi1</dc:creator>
      <dc:date>2018-03-05T21:01:13Z</dc:date>
    </item>
  </channel>
</rss>

