<?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: sorting based on value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/sorting-based-on-value/m-p/89527#M22960</link>
    <description>&lt;P&gt;Yes, there is a couple of ways you can do this. Note that your timestamp gets put into a field called _time.&lt;BR /&gt;&lt;BR /&gt;
If you want to use average figures over a timerange, you can use the timechart function. Eg:&lt;/P&gt;

&lt;P&gt;search command | timechart avg(pageLoadSeconds) as AvgPageLoadTime&lt;/P&gt;

&lt;P&gt;If for some reason you want to graph the raw values of pageLoadSeconds, you can just create a table with the values you want, eg:&lt;/P&gt;

&lt;P&gt;search command | table _time, pageLoadSeconds&lt;/P&gt;

&lt;P&gt;Note, the graphs in Splunk will only plot up to 1000 events, so if you use the table option you won't be able to do it over a lot of data. It's recommended to use timechart.&lt;/P&gt;

&lt;P&gt;Either of these can be used to populate a Splunk graph.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
Herbie.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Apr 2011 23:25:44 GMT</pubDate>
    <dc:creator>herbie</dc:creator>
    <dc:date>2011-04-27T23:25:44Z</dc:date>
    <item>
      <title>sorting based on value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sorting-based-on-value/m-p/89524#M22957</link>
      <description>&lt;P&gt;one of my log file has this key-value: pageLoadTime=xxx, where xxx is number of milliseconds.&lt;/P&gt;

&lt;P&gt;how do I write the search to sort by xxx, so the biggest pageLoadTime is on the top? I tried "|top pageLoadTime" but that sort by number of occurence of xxx.&lt;/P&gt;

&lt;P&gt;thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2011 02:28:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sorting-based-on-value/m-p/89524#M22957</guid>
      <dc:creator>tinhuty</dc:creator>
      <dc:date>2011-04-27T02:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: sorting based on value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sorting-based-on-value/m-p/89525#M22958</link>
      <description>&lt;P&gt;On the end of your search, add the sort function. Eg:&lt;/P&gt;

&lt;P&gt;... | sort -pageLoadTime&lt;/P&gt;

&lt;P&gt;Cheers.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2011 05:01:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sorting-based-on-value/m-p/89525#M22958</guid>
      <dc:creator>herbie</dc:creator>
      <dc:date>2011-04-27T05:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: sorting based on value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sorting-based-on-value/m-p/89526#M22959</link>
      <description>&lt;P&gt;Thanks very much herbie, that works, now the4 eventdata are sorted by pageLoadTime. My log data also has timestamp, the simplified sample log entry is like:&lt;/P&gt;

&lt;P&gt;[04/26/2011 14:03:27,832][DEBUG]:page=Order.aspx, pageLoadSeconds=0.1093687&lt;/P&gt;

&lt;P&gt;Is there command to make it a chart, with pageLoadTime as Y-axis and timestamp as X-axis? what will be very helpful to see exactly when those slow pageload happened.&lt;/P&gt;

&lt;P&gt;I just started using couple days ago that there are lots of commands I need to learn.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2011 15:03:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sorting-based-on-value/m-p/89526#M22959</guid>
      <dc:creator>tinhuty</dc:creator>
      <dc:date>2011-04-27T15:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: sorting based on value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sorting-based-on-value/m-p/89527#M22960</link>
      <description>&lt;P&gt;Yes, there is a couple of ways you can do this. Note that your timestamp gets put into a field called _time.&lt;BR /&gt;&lt;BR /&gt;
If you want to use average figures over a timerange, you can use the timechart function. Eg:&lt;/P&gt;

&lt;P&gt;search command | timechart avg(pageLoadSeconds) as AvgPageLoadTime&lt;/P&gt;

&lt;P&gt;If for some reason you want to graph the raw values of pageLoadSeconds, you can just create a table with the values you want, eg:&lt;/P&gt;

&lt;P&gt;search command | table _time, pageLoadSeconds&lt;/P&gt;

&lt;P&gt;Note, the graphs in Splunk will only plot up to 1000 events, so if you use the table option you won't be able to do it over a lot of data. It's recommended to use timechart.&lt;/P&gt;

&lt;P&gt;Either of these can be used to populate a Splunk graph.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
Herbie.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2011 23:25:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sorting-based-on-value/m-p/89527#M22960</guid>
      <dc:creator>herbie</dc:creator>
      <dc:date>2011-04-27T23:25:44Z</dc:date>
    </item>
  </channel>
</rss>

