<?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 can I sort a field alphabetically and then by total? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365220#M107709</link>
    <description>&lt;P&gt;I have the following search in which I'm trying to sort first alphabetically and then by total, but the Processes field is not sorting alphabetically. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sysmon | stats count by process,ParentImage | sort -count | stats dc(process) as Total, list(process) as Processes by ParentImage | sort +str(Processes), -total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any idea as to what I'm missing or not doing correctly?&lt;BR /&gt;
Thx&lt;/P&gt;</description>
    <pubDate>Mon, 14 Aug 2017 19:36:32 GMT</pubDate>
    <dc:creator>jwalzerpitt</dc:creator>
    <dc:date>2017-08-14T19:36:32Z</dc:date>
    <item>
      <title>How can I sort a field alphabetically and then by total?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365220#M107709</link>
      <description>&lt;P&gt;I have the following search in which I'm trying to sort first alphabetically and then by total, but the Processes field is not sorting alphabetically. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sysmon | stats count by process,ParentImage | sort -count | stats dc(process) as Total, list(process) as Processes by ParentImage | sort +str(Processes), -total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any idea as to what I'm missing or not doing correctly?&lt;BR /&gt;
Thx&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 19:36:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365220#M107709</guid>
      <dc:creator>jwalzerpitt</dc:creator>
      <dc:date>2017-08-14T19:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort a field alphabetically and then by total?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365221#M107710</link>
      <description>&lt;P&gt;Modified search to as below, but still no luck&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sysmon | stats count by process,ParentImage | sort +str(process),-count | stats dc(process) as Total, list(process) as Processes by ParentImage | sort +str(Processes), -total
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Aug 2017 19:39:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365221#M107710</guid>
      <dc:creator>jwalzerpitt</dc:creator>
      <dc:date>2017-08-14T19:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort a field alphabetically and then by total?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365222#M107711</link>
      <description>&lt;P&gt;What sort order are you getting?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 19:54:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365222#M107711</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-08-14T19:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort a field alphabetically and then by total?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365223#M107712</link>
      <description>&lt;P&gt;I get the correct sort order based on Total, but the Processes field is all over the place. Here's from the first listing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    cmd.exe
notepad++.exe
Update.exe
aruser.exe
firefox.exe
runonce.exe
Box Edit.exe
Box Local Com Service.exe
CCleaner64.exe
DellSystemDetect.exe
IAStorIconLaunch.exe
ImageTray.exe
ONENOTEM.EXE
OUTLOOK.EXE
OneDrive.exe
RDCMan.exe
SnippingTool.exe
WINWORD.EXE
chrome.exe
explorer.exe
lync.exe
netsession_win.exe
vmtoolsd.exe 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Aug 2017 20:00:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365223#M107712</guid>
      <dc:creator>jwalzerpitt</dc:creator>
      <dc:date>2017-08-14T20:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort a field alphabetically and then by total?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365224#M107713</link>
      <description>&lt;P&gt;The Processes field in the end is a multivalued field hence doesn't get sorted using sort command. Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sysmon | stats count by process,ParentImage | sort -count | stats dc(process) as Total, list(process) as Processes by ParentImage | eval Processes=mvsort(Processes) | sort -total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please note that Processes are sorted lexicographically (upper case are sorted first then lower case)&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 20:38:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365224#M107713</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-14T20:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort a field alphabetically and then by total?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365225#M107714</link>
      <description>&lt;P&gt;Thx as that worked (as well as the explanation on sorting lexicographically). With that knowledge, I modified my search as below which allowed for sorting alphabetically on the Processes field. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sysmon | eval process=lower(process) | stats count by process,ParentImage | sort -count | stats dc(process) as Total, list(process) as Processes by ParentImage | eval Processes=mvsort(Processes) | sort -total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please copy your reply into the answer field so I can mark it as such, and thx again for the help!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 20:49:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365225#M107714</guid>
      <dc:creator>jwalzerpitt</dc:creator>
      <dc:date>2017-08-14T20:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort a field alphabetically and then by total?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365226#M107715</link>
      <description>&lt;P&gt;Here you go.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 20:53:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365226#M107715</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-14T20:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort a field alphabetically and then by total?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365227#M107716</link>
      <description>&lt;P&gt;Thx again!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 20:57:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-a-field-alphabetically-and-then-by-total/m-p/365227#M107716</guid>
      <dc:creator>jwalzerpitt</dc:creator>
      <dc:date>2017-08-14T20:57:28Z</dc:date>
    </item>
  </channel>
</rss>

