<?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: Different values of parameters in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Different-values-of-parameters/m-p/183137#M52734</link>
    <description>&lt;P&gt;Try the updated answer.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jun 2014 21:13:27 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-06-03T21:13:27Z</dc:date>
    <item>
      <title>Different values of parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Different-values-of-parameters/m-p/183133#M52730</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have below variations of uri patterns for a particular functionality. i want to list out query string parameters and their values separately (in a tabular format or any other format).&lt;/P&gt;

&lt;P&gt;Say for example&lt;/P&gt;

&lt;P&gt;For q&lt;BR /&gt;
value count&lt;BR /&gt;
XXX    5&lt;BR /&gt;
YYY    3&lt;/P&gt;

&lt;P&gt;i tried to use rex and extract fileds (q, Index, items, country, lan) but as the uri formats are in different right boundaries (for example q has right boundary &amp;amp; in 1st and 2nd uri pattern but i the 3rd it has no &amp;amp;). So how do we deal with these kind of situations? &lt;/P&gt;

&lt;P&gt;Uri formats: &lt;/P&gt;

&lt;P&gt;/perform?q=XXX&amp;amp;Index=XXX&amp;amp;items=XXX&lt;BR /&gt;
/perform?q=XXX&amp;amp;Index=XXX&amp;amp;items=XXX&amp;amp;account=&amp;amp;country=XXX&amp;amp;lan=XXX&lt;BR /&gt;
/perform?q=YYY&lt;BR /&gt;
/perform?q=YYY&amp;amp;account=XXX&lt;BR /&gt;
/perform?q=YYY&amp;amp;Index=XXX&amp;amp;items=XXX&amp;amp;account=XXX&amp;amp;country=XXX&amp;amp;lan=XXX&lt;BR /&gt;
/perform?q=XXX&amp;amp;account=XXX&amp;amp;items=XXX&lt;BR /&gt;
/perform?q=XXX&amp;amp;account=XXX&amp;amp;country=XXX&lt;BR /&gt;
/perform?q=XXX&amp;amp;Index=XXX&amp;amp;items=XXX&lt;BR /&gt;
/perform?q=XXX&amp;amp;account=XXX&amp;amp;Index=XXX&amp;amp;items=XXX&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2014 20:26:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Different-values-of-parameters/m-p/183133#M52730</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2014-05-29T20:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Different values of parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Different-values-of-parameters/m-p/183134#M52731</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;&amp;lt;your base search giving field uri &amp;gt;&amp;gt;| rex field=uri "q=(?&amp;lt;q&amp;gt;.*)" | eval q="a=".q | rex field=q max_match=0 "(\w+=)+(?&amp;lt;value&amp;gt;[^&amp;amp;]+)" | mvexpand value | stats count by value
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;&amp;lt;your base search giving field uri &amp;gt;&amp;gt; | rex field=uri "q=(?&amp;lt;q&amp;gt;.*)" | eval q="q=".q | rex field=q max_match=0 "(?&amp;lt;key&amp;gt;\w+)=(?&amp;lt;value&amp;gt;[^&amp;amp;]+)" | eval temp=mvzip(key,value) | mvexpand temp | rex field=temp "(?&amp;lt;key&amp;gt;.*),(?&amp;lt;value&amp;gt;.*)" | stats count by key,value | stats list(count) list(value) by key
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 May 2014 20:41:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Different-values-of-parameters/m-p/183134#M52731</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-05-29T20:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Different values of parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Different-values-of-parameters/m-p/183135#M52732</link>
      <description>&lt;P&gt;Hi, if i understand it correctly, you are getting the query string into q and i did not get why you have eval q="a=".q and then you are taking that result and you are trying to separate the values using &amp;amp; and you have max_match=0 as it has multi value field?&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jun 2014 20:45:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Different-values-of-parameters/m-p/183135#M52732</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2014-06-01T20:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Different values of parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Different-values-of-parameters/m-p/183136#M52733</link>
      <description>&lt;P&gt;i have tried the query and it is giving me all the value but it is not separating by each key. Meaning for q these are all the values, account these are all the values, index these are all the values, etc&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jun 2014 21:06:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Different-values-of-parameters/m-p/183136#M52733</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2014-06-01T21:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Different values of parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Different-values-of-parameters/m-p/183137#M52734</link>
      <description>&lt;P&gt;Try the updated answer.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2014 21:13:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Different-values-of-parameters/m-p/183137#M52734</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-03T21:13:27Z</dc:date>
    </item>
  </channel>
</rss>

