<?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 Rex extracted test in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Rex-extracted-test/m-p/329653#M98122</link>
    <description>&lt;P&gt;Thanks Duke! Since the extracted text was part of a single value field this solution didn't work.&lt;/P&gt;

&lt;P&gt;Appreciate your response though!&lt;/P&gt;</description>
    <pubDate>Fri, 03 Mar 2017 06:31:05 GMT</pubDate>
    <dc:creator>nithinthomas</dc:creator>
    <dc:date>2017-03-03T06:31:05Z</dc:date>
    <item>
      <title>Sorting Rex extracted test</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Rex-extracted-test/m-p/329650#M98119</link>
      <description>&lt;P&gt;My rex output extract gives following output in different environment. Is there any query to sort the returned text so that we get similar output all the time?&lt;/P&gt;

&lt;P&gt;DocumentID=xxxx,ResponseType=xxxx,PO=xxxx,VID=xxxxx&lt;/P&gt;

&lt;P&gt;DocumentID=xxxx,PO=xxxxx,VID=xxxx,ResponseType=xxxxx&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 14:29:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Rex-extracted-test/m-p/329650#M98119</guid>
      <dc:creator>nithinthomas</dc:creator>
      <dc:date>2017-03-02T14:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Rex extracted test</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Rex-extracted-test/m-p/329651#M98120</link>
      <description>&lt;P&gt;Are you just wanting to order your fields ?&lt;/P&gt;

&lt;P&gt;Maybe add &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|stats count(DocumentID) as COUNT by DocumentID, ResponseType,PO,VID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or whatever order you want them in or counted by. &lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 17:57:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Rex-extracted-test/m-p/329651#M98120</guid>
      <dc:creator>JDukeSplunk</dc:creator>
      <dc:date>2017-03-02T17:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Rex extracted test</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Rex-extracted-test/m-p/329652#M98121</link>
      <description>&lt;P&gt;Assuming the whole string &lt;CODE&gt;DocumentID=xxxx,ResponseType=xxxx,PO=xxxx,VID=xxxxx&lt;/CODE&gt; (and other value) are extracted from raw data as part of a single value field, the rex command itself can't change the value available in raw data. You may manipulate the value after extractions. Following example will sort the value based on the key names inside your field (e.g. DocumentID, ResponseType etc) and always return in order &lt;CODE&gt;DocumentID=xxxx,PO=xxxx,ResponseType=xxxx,VID=xxxxx&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "...(?&amp;lt;FieldNameHere&amp;gt;...." | makemv FieldNameHere delim="," | eval FieldNameHere=mvsort(FieldNameHere) | nomv FieldNameHere
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Mar 2017 19:39:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Rex-extracted-test/m-p/329652#M98121</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-02T19:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Rex extracted test</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Rex-extracted-test/m-p/329653#M98122</link>
      <description>&lt;P&gt;Thanks Duke! Since the extracted text was part of a single value field this solution didn't work.&lt;/P&gt;

&lt;P&gt;Appreciate your response though!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 06:31:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Rex-extracted-test/m-p/329653#M98122</guid>
      <dc:creator>nithinthomas</dc:creator>
      <dc:date>2017-03-03T06:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Rex extracted test</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Rex-extracted-test/m-p/329654#M98123</link>
      <description>&lt;P&gt;This worked. Thank you!&lt;/P&gt;

&lt;P&gt;you are awesome!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 06:32:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Rex-extracted-test/m-p/329654#M98123</guid>
      <dc:creator>nithinthomas</dc:creator>
      <dc:date>2017-03-03T06:32:01Z</dc:date>
    </item>
  </channel>
</rss>

