<?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: Need to sort macOS versions in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-to-sort-macOS-versions/m-p/471815#M132754</link>
    <description>&lt;P&gt;@jbandautrgv,&lt;/P&gt;

&lt;P&gt;That's because version is a string and hence it sorts in lexicographical  order&lt;/P&gt;

&lt;P&gt;Try &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="endpoint_apple" sourcetype="jamf:computers" 
| eval Operating_System_Version_Major = substr(Operating_System_Version, 1, len(Operating_System_Version)-2) 
| chart count(Operating_System_Version_Major) as count by Operating_System_Version_Major 
| eval num=replace(version,"\.","")|sort num|fields - num
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 05 Sep 2019 03:39:10 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2019-09-05T03:39:10Z</dc:date>
    <item>
      <title>Need to sort macOS versions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-sort-macOS-versions/m-p/471814#M132753</link>
      <description>&lt;P&gt;I imported data from jamf cloud into splunk and one of the fields being returned is the operating system version.  It seems to be in a x.y.z format.  I am removing the last two characters to get a count of the "major" versions to get a report by count.  So far this works, but I'm trying to sort by the operating system version and the sorting doesn't seem to work.  This is my search:&lt;/P&gt;

&lt;P&gt;index="endpoint_apple" sourcetype="jamf:computers" | eval Operating_System_Version_Major = substr(Operating_System_Version, 1, len(Operating_System_Version)-2) | chart count(Operating_System_Version_Major) as count by Operating_System_Version_Major | sort -Operating_System_Version_Major&lt;/P&gt;

&lt;P&gt;The data is being returned like this:&lt;/P&gt;

&lt;P&gt;Operating_System_Version_Major  count&lt;BR /&gt;
10.9    2&lt;BR /&gt;
10.8    1&lt;BR /&gt;
10.7    3&lt;BR /&gt;
10.15   6&lt;BR /&gt;
10.14   362&lt;BR /&gt;
10.13   321&lt;BR /&gt;
10.12   259&lt;BR /&gt;
10.11   73&lt;BR /&gt;
10.10   5&lt;/P&gt;

&lt;P&gt;I cannot figure out why 10.7 through 10.9 are being sorted higher than 10.15.  I've tried "sort -num*Operating_System_Version_Major)" with no change, and I also have alternated between "chart" and "stats" to get the count.  I've also attempted to remove the eval and just sort on Operating_System_Version with the same results.  I'm not really sure what I'm missing, so if someone can point me in the right direction, I'd appreciate it.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:03:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-sort-macOS-versions/m-p/471814#M132753</guid>
      <dc:creator>jbandautrgv</dc:creator>
      <dc:date>2020-09-30T02:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need to sort macOS versions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-sort-macOS-versions/m-p/471815#M132754</link>
      <description>&lt;P&gt;@jbandautrgv,&lt;/P&gt;

&lt;P&gt;That's because version is a string and hence it sorts in lexicographical  order&lt;/P&gt;

&lt;P&gt;Try &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="endpoint_apple" sourcetype="jamf:computers" 
| eval Operating_System_Version_Major = substr(Operating_System_Version, 1, len(Operating_System_Version)-2) 
| chart count(Operating_System_Version_Major) as count by Operating_System_Version_Major 
| eval num=replace(version,"\.","")|sort num|fields - num
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Sep 2019 03:39:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-sort-macOS-versions/m-p/471815#M132754</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-09-05T03:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Need to sort macOS versions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-sort-macOS-versions/m-p/471816#M132755</link>
      <description>&lt;P&gt;Thank you, I see what you did.  I was hoping I could force splunk to treat "10.15" as a decimal and sort it like that, but what you suggested converting "10.15" to "1015" did work.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 13:13:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-sort-macOS-versions/m-p/471816#M132755</guid>
      <dc:creator>jbandautrgv</dc:creator>
      <dc:date>2019-09-05T13:13:13Z</dc:date>
    </item>
  </channel>
</rss>

