<?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: My dashboard modifies the search command &amp;quot;sor&amp;quot;t and &amp;quot;fields&amp;quot; in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/My-dashboard-modifies-the-search-command-quot-sor-quot-t-and/m-p/261264#M78402</link>
    <description>&lt;P&gt;Check out the sort documentation: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Sort"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Sort&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Give this a shot instead. This is the correct syntax:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sort 0 -_time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 30 Aug 2016 13:18:30 GMT</pubDate>
    <dc:creator>jpolcari</dc:creator>
    <dc:date>2016-08-30T13:18:30Z</dc:date>
    <item>
      <title>My dashboard modifies the search command "sor"t and "fields"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-dashboard-modifies-the-search-command-quot-sor-quot-t-and/m-p/261263#M78401</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I have a search rule that is perfectly working:&lt;BR /&gt;
.... | &lt;BR /&gt;
sort - 0 _time | &lt;BR /&gt;
fields - _* | &lt;BR /&gt;
fields data1 data 2 data3&lt;/P&gt;

&lt;P&gt;I have created a dashboard and integrated the rule. &lt;BR /&gt;
The result of the rule is wrong and I discovered that the string search had been modified:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;"sort - 0 _time"  =&amp;gt;   "sort-0 _time"&lt;/STRONG&gt; and this command does not work; it does not sort &lt;EM&gt;time in the correct order&lt;BR /&gt;
"fields - _*" gets " fields-&lt;/EM&gt;*"    which is not doing the same thing; it does not remove the fields beginning by _&lt;/P&gt;

&lt;P&gt;I have done many tests and this is reproductible 100%. &lt;BR /&gt;
Each time the generation of the dashboard xml code corrupt my search string and I can not create a working dashboard.&lt;/P&gt;

&lt;P&gt;Any ideas are welcome&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 13:13:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-dashboard-modifies-the-search-command-quot-sor-quot-t-and/m-p/261263#M78401</guid>
      <dc:creator>clorne</dc:creator>
      <dc:date>2016-08-30T13:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: My dashboard modifies the search command "sor"t and "fields"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-dashboard-modifies-the-search-command-quot-sor-quot-t-and/m-p/261264#M78402</link>
      <description>&lt;P&gt;Check out the sort documentation: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Sort"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Sort&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Give this a shot instead. This is the correct syntax:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sort 0 -_time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Aug 2016 13:18:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-dashboard-modifies-the-search-command-quot-sor-quot-t-and/m-p/261264#M78402</guid>
      <dc:creator>jpolcari</dc:creator>
      <dc:date>2016-08-30T13:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: My dashboard modifies the search command "sor"t and "fields"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-dashboard-modifies-the-search-command-quot-sor-quot-t-and/m-p/261265#M78403</link>
      <description>&lt;P&gt;I think you are running into a syntax issue.  FIELDS and SORT use the '-' differently.  For sort, there is no space between the minus and the field you want to sort in descending order:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sort 0 -_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not sure if you have a typo on your FIELDS command above, but I think what you were shooting for was:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;fields - _*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If your intended result was to end up with only the three fields at the end, you should be able to do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.... |
sort 0 -_time |
table data1 data2 data3
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Aug 2016 13:28:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-dashboard-modifies-the-search-command-quot-sor-quot-t-and/m-p/261265#M78403</guid>
      <dc:creator>justinatpnnl</dc:creator>
      <dc:date>2016-08-30T13:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: My dashboard modifies the search command "sor"t and "fields"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-dashboard-modifies-the-search-command-quot-sor-quot-t-and/m-p/261266#M78404</link>
      <description>&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 15:14:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-dashboard-modifies-the-search-command-quot-sor-quot-t-and/m-p/261266#M78404</guid>
      <dc:creator>clorne</dc:creator>
      <dc:date>2016-08-30T15:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: My dashboard modifies the search command "sor"t and "fields"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-dashboard-modifies-the-search-command-quot-sor-quot-t-and/m-p/261267#M78405</link>
      <description>&lt;P&gt;Thansk a lot&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 15:14:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-dashboard-modifies-the-search-command-quot-sor-quot-t-and/m-p/261267#M78405</guid>
      <dc:creator>clorne</dc:creator>
      <dc:date>2016-08-30T15:14:23Z</dc:date>
    </item>
  </channel>
</rss>

