<?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: Set Sort Order in Splunk Panel in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Set-Sort-Order-in-Splunk-Panel/m-p/316664#M94748</link>
    <description>&lt;P&gt;Clever answer! This seems like common sense now that I see it. I must've been too caught up in the problem to find the solution. Thank you so much!&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jul 2017 12:27:56 GMT</pubDate>
    <dc:creator>chlebs</dc:creator>
    <dc:date>2017-07-19T12:27:56Z</dc:date>
    <item>
      <title>Set Sort Order in Splunk Panel</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Set-Sort-Order-in-Splunk-Panel/m-p/316661#M94745</link>
      <description>&lt;P&gt;I have made a dashboard with a few panels on it, each of which contains a _time field and an environment field that the panels are sorted by. The primary sorting field is environment, then _time comes second. Below I will place an example search from one of the panels. I am wondering if I can preset the order of the sorting. There are 4 possible values for the environment variable: Test, Stage, Train, and Production. That is the order they should be in, but the sort command sorts alphabetically and places them in the order: Train, Test, Stage, Production. Thank you in advance to anyone who helps me with this.&lt;/P&gt;

&lt;P&gt;Example Code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=java sourcetype=j2ee source="/opt/jbosslogs/profileData.log" web{ profile=$app_tok$ | eval environment=case(like(host, "%t"), "Test", like(host, "%s"), "Stage", like(host, "%n"), "Train", like(host, "%p"), "Production") | table _time, environment, host, proxy_name, path, pattern | sort -environment, _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jul 2017 11:24:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Set-Sort-Order-in-Splunk-Panel/m-p/316661#M94745</guid>
      <dc:creator>chlebs</dc:creator>
      <dc:date>2017-07-19T11:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Set Sort Order in Splunk Panel</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Set-Sort-Order-in-Splunk-Panel/m-p/316662#M94746</link>
      <description>&lt;P&gt;Here is sort based on example 5 of Sort from &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Sort"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Sort&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=java sourcetype=j2ee source="/opt/jbosslogs/profileData.log" web{ profile=$app_tok$ | eval environment=case(like(host, "%t"), "Test", like(host, "%s"), "Stage", like(host, "%n"), "Train", like(host, "%p"), "Production") | table _time, environment, host, proxy_name, path, pattern | eval sort_environment=case(environment=="Train",1, environment=="Test",2, environment=="Stage",3, environment=="Production",4) | sort -sort_environment, _time | fields - sort_environment
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jul 2017 12:04:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Set-Sort-Order-in-Splunk-Panel/m-p/316662#M94746</guid>
      <dc:creator>Grumpalot</dc:creator>
      <dc:date>2017-07-19T12:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set Sort Order in Splunk Panel</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Set-Sort-Order-in-Splunk-Panel/m-p/316663#M94747</link>
      <description>&lt;P&gt;With the reverse of Test, Stage, Train, and Production&lt;/P&gt;

&lt;P&gt;Production = 4&lt;BR /&gt;
Train = 3&lt;BR /&gt;
Stage = 2&lt;BR /&gt;
Test = 1&lt;/P&gt;

&lt;P&gt;Sorry missed the order was more of a -- this should work for you just have to change the parameters.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 12:10:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Set-Sort-Order-in-Splunk-Panel/m-p/316663#M94747</guid>
      <dc:creator>Grumpalot</dc:creator>
      <dc:date>2017-07-19T12:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: Set Sort Order in Splunk Panel</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Set-Sort-Order-in-Splunk-Panel/m-p/316664#M94748</link>
      <description>&lt;P&gt;Clever answer! This seems like common sense now that I see it. I must've been too caught up in the problem to find the solution. Thank you so much!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 12:27:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Set-Sort-Order-in-Splunk-Panel/m-p/316664#M94748</guid>
      <dc:creator>chlebs</dc:creator>
      <dc:date>2017-07-19T12:27:56Z</dc:date>
    </item>
  </channel>
</rss>

