<?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 sort() version values. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-sort-version-values/m-p/532919#M150548</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am having values of a particular application as below.&lt;/P&gt;&lt;P&gt;Looking to get the maximum version value or sorting them in order so that i can pick the last/first value in my search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Values i have for applicationA:&lt;/P&gt;&lt;DIV class="multivalue-subcell"&gt;1.17.120&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.12.600&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.14.377&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.14.378&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.15.121&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.16.298&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.17.176&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.18.117&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;&lt;DIV class="multivalue-subcell"&gt;2.4.153&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.6.186&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.7.241&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.7.242&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.8.207&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.9.369&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Value i am looking for :&lt;/P&gt;&lt;DIV class="multivalue-subcell"&gt;2.18.117&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know we can use case() to add numbers and sort in order. But i have more than 20+ applications with similar data.&lt;/P&gt;&lt;P&gt;Out of them i have to get the Maximum values for each application data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
    <pubDate>Sun, 13 Dec 2020 12:38:47 GMT</pubDate>
    <dc:creator>karthik_y</dc:creator>
    <dc:date>2020-12-13T12:38:47Z</dc:date>
    <item>
      <title>how to sort() version values.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sort-version-values/m-p/532919#M150548</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am having values of a particular application as below.&lt;/P&gt;&lt;P&gt;Looking to get the maximum version value or sorting them in order so that i can pick the last/first value in my search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Values i have for applicationA:&lt;/P&gt;&lt;DIV class="multivalue-subcell"&gt;1.17.120&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.12.600&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.14.377&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.14.378&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.15.121&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.16.298&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.17.176&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.18.117&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;&lt;DIV class="multivalue-subcell"&gt;2.4.153&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.6.186&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.7.241&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.7.242&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.8.207&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;2.9.369&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Value i am looking for :&lt;/P&gt;&lt;DIV class="multivalue-subcell"&gt;2.18.117&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know we can use case() to add numbers and sort in order. But i have more than 20+ applications with similar data.&lt;/P&gt;&lt;P&gt;Out of them i have to get the Maximum values for each application data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2020 12:38:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sort-version-values/m-p/532919#M150548</guid>
      <dc:creator>karthik_y</dc:creator>
      <dc:date>2020-12-13T12:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort() version values.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sort-version-values/m-p/532930#M150549</link>
      <description>&lt;P&gt;You could add a leading zero to the middle part of the version number so that they will sort lexicographically&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex mode=sed field=versions "s/\.(?&amp;lt;digit&amp;gt;\d)\./.0\1./g"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2020 18:43:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sort-version-values/m-p/532930#M150549</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-12-13T18:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort() version values.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sort-version-values/m-p/532936#M150550</link>
      <description>&lt;P&gt;Hi, you can also extract each part of the field and then display only the maximum value:&lt;/P&gt;&lt;P&gt;|rex field=ApplicationA "^(?P&amp;lt;m1&amp;gt;\d+)\.(?P&amp;lt;m2&amp;gt;\d+)\.(?P&amp;lt;m3&amp;gt;\d+)"|eventstats max(m1) as max_first_part|sort- m2|where m1=max_first_part|head 1&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2020 19:55:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sort-version-values/m-p/532936#M150550</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2020-12-13T19:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort() version values.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sort-version-values/m-p/533454#M150734</link>
      <description>&lt;P&gt;Thank you. I have got what i am looking for.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 14:03:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sort-version-values/m-p/533454#M150734</guid>
      <dc:creator>karthik_y</dc:creator>
      <dc:date>2020-12-17T14:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort() version values.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sort-version-values/m-p/556234#M157945</link>
      <description>&lt;P&gt;When I have to do this, I'm quite surprised that SPL hasn't offered a function for just this. &amp;nbsp;Searching this forum discovered multiple workarounds based on conversion to numerals, padding 0, etc., perhaps the earliest from 2015. &amp;nbsp;But this 2018 solution by&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/56406"&gt;@acharlieh&lt;/a&gt;&amp;nbsp;is more intriguing: &lt;A href="https://community.splunk.com/t5/Splunk-Search/Help-With-Sorting-Multiple-Decimal-Points/m-p/314798/highlight/true#M94212" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/Help-With-Sorting-Multiple-Decimal-Points/m-p/314798/highlight/true#M94212&lt;/A&gt;. &amp;nbsp;It&amp;nbsp;doesn't modify the field value, which can of practical importance; instead, it uses ip() function to sort each dot section numerically:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| sort ip(version)&lt;/LI-CODE&gt;&lt;P&gt;The post discusses its limitations, but should work well for most use. (The dotted notation doesn't have to be 4 sections.) &amp;nbsp;Thanks, &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/56406"&gt;@acharlieh&lt;/a&gt;!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 20:20:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sort-version-values/m-p/556234#M157945</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2021-06-17T20:20:15Z</dc:date>
    </item>
  </channel>
</rss>

