<?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 edit my search to sort individual values in fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-sort-individual-values-in-fields/m-p/285461#M86370</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I have the following search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"result generating search"| eval z=mvzip(Bundle, Load_Time) | mvexpand z | streamstats window=2 current=f range(Load_Time) as time_diff by Machine_Serial| eval time_diff=if(isnull(time_diff), now()-Load_Time, time_diff)| eval timed=time_diff/86400 | stats dc(Bundle) as count values(Bundle) as Bundle values(_time) as time list(time2) as Date values(time_diff) as time_diff values(timed) as tim_diff(H) by Machine_Serial | sort 0 -num(tim_diff(H)) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which returns a table that looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; Machine_Serial  count  Bundle  time       Date        time_diff       tim_diff(H)
____________________________________________________________________________________________
 75123           3      1.1     1458049413  2016/03/16  6702139.000000   1134.5710532407 
                        1.3     1458053068  2013/04/2   98026939.000000  1135.5710532407
                        1.4     1464618084  2013/04/23  98113339.000000  77.57105324074 
--------------------------------------------------------------------------------------------
 75334           1      1.5     1464788901  2012/10/17  114356539.000000 1323.57105324074
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've been trying to sort based on the values of time_diff(H) using the sort command, however, it doesn't seem to work on the values in the same under the same group, so they'll be mismatched internally. I've attempted various sort commands, as well placing it in different locations, but I haven't been able to crack it. Is there any I can achieve this? &lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jun 2016 21:09:36 GMT</pubDate>
    <dc:creator>raby1996</dc:creator>
    <dc:date>2016-06-01T21:09:36Z</dc:date>
    <item>
      <title>How to edit my search to sort individual values in fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-sort-individual-values-in-fields/m-p/285461#M86370</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I have the following search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"result generating search"| eval z=mvzip(Bundle, Load_Time) | mvexpand z | streamstats window=2 current=f range(Load_Time) as time_diff by Machine_Serial| eval time_diff=if(isnull(time_diff), now()-Load_Time, time_diff)| eval timed=time_diff/86400 | stats dc(Bundle) as count values(Bundle) as Bundle values(_time) as time list(time2) as Date values(time_diff) as time_diff values(timed) as tim_diff(H) by Machine_Serial | sort 0 -num(tim_diff(H)) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which returns a table that looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; Machine_Serial  count  Bundle  time       Date        time_diff       tim_diff(H)
____________________________________________________________________________________________
 75123           3      1.1     1458049413  2016/03/16  6702139.000000   1134.5710532407 
                        1.3     1458053068  2013/04/2   98026939.000000  1135.5710532407
                        1.4     1464618084  2013/04/23  98113339.000000  77.57105324074 
--------------------------------------------------------------------------------------------
 75334           1      1.5     1464788901  2012/10/17  114356539.000000 1323.57105324074
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've been trying to sort based on the values of time_diff(H) using the sort command, however, it doesn't seem to work on the values in the same under the same group, so they'll be mismatched internally. I've attempted various sort commands, as well placing it in different locations, but I haven't been able to crack it. Is there any I can achieve this? &lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 21:09:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-sort-individual-values-in-fields/m-p/285461#M86370</guid>
      <dc:creator>raby1996</dc:creator>
      <dc:date>2016-06-01T21:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to sort individual values in fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-sort-individual-values-in-fields/m-p/285462#M86371</link>
      <description>&lt;P&gt;Try sorting before the stats command?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 22:58:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-sort-individual-values-in-fields/m-p/285462#M86371</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-01T22:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to sort individual values in fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-sort-individual-values-in-fields/m-p/285463#M86372</link>
      <description>&lt;P&gt;I've tried that, and the results are the same, still I appreciate the help.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 00:17:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-sort-individual-values-in-fields/m-p/285463#M86372</guid>
      <dc:creator>raby1996</dc:creator>
      <dc:date>2016-06-02T00:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to sort individual values in fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-sort-individual-values-in-fields/m-p/285464#M86373</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"result generating search"| eval z=mvzip(Bundle, Load_Time) | mvexpand z | streamstats window=2 current=f range(Load_Time) as time_diff by Machine_Serial| eval time_diff=if(isnull(time_diff), now()-Load_Time, time_diff)| eval timed=time_diff/86400 
| stats count by Machine_Serial Bundle _time time2 time_diff times
| sort 0 Machine_Serial -num(timed) 
| stats dc(Bundle) as count list(Bundle) as Bundle list(_time) as time list(time2) as Date list(time_diff) as time_diff list(timed) as tim_diff(H) by Machine_Serial | sort 0 -num(tim_diff(H)) 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Jun 2016 04:52:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-sort-individual-values-in-fields/m-p/285464#M86373</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-02T04:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to sort individual values in fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-sort-individual-values-in-fields/m-p/285465#M86374</link>
      <description>&lt;P&gt;Worked flawlessly, thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 18:16:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-sort-individual-values-in-fields/m-p/285465#M86374</guid>
      <dc:creator>raby1996</dc:creator>
      <dc:date>2016-06-02T18:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to sort individual values in fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-sort-individual-values-in-fields/m-p/285466#M86375</link>
      <description>&lt;P&gt;one note I changed the "times" to" timed" at the end of the 4th line&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 18:17:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-sort-individual-values-in-fields/m-p/285466#M86375</guid>
      <dc:creator>raby1996</dc:creator>
      <dc:date>2016-06-02T18:17:37Z</dc:date>
    </item>
  </channel>
</rss>

