<?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: Regex  for capturing multiple values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-capturing-multiple-values/m-p/136159#M37238</link>
    <description>&lt;P&gt;Hi the event i gave is just an example. Those parameter names would be different across different urls. So it won't work for all the urls&lt;/P&gt;</description>
    <pubDate>Sun, 10 Nov 2013 16:34:17 GMT</pubDate>
    <dc:creator>xvxt006</dc:creator>
    <dc:date>2013-11-10T16:34:17Z</dc:date>
    <item>
      <title>Regex  for capturing multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-capturing-multiple-values/m-p/136157#M37236</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to capture all query string names (but not values as a list). I tried the below expression but i think it is capturing only the first one but not the rest. Any help is appreciated&lt;/P&gt;

&lt;P&gt;rex field=uri "\?(?&lt;QUERYSTRINGNAME&gt;(?:([^?(?:=.*)&amp;amp;]+)))" &lt;/QUERYSTRINGNAME&gt;&lt;/P&gt;

&lt;P&gt;Below is an example event. &lt;/P&gt;

&lt;P&gt;GET /Ntt-valve+Butterfly+Valves,?L1=Butterfly+Valves%25252C&amp;amp;L2=Stainless-Steel&amp;amp;Ndr=textsearchesinbase%252Btrue&amp;amp;operator=prodIndexRefinementSearch&amp;amp;originalValue=valve&amp;amp;sst=All&lt;/P&gt;

&lt;P&gt;So i need&lt;BR /&gt;
L1&lt;BR /&gt;
L2&lt;BR /&gt;
Ndr&lt;BR /&gt;
operator&lt;BR /&gt;
originalValue&lt;BR /&gt;
sst&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2013 16:09:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-capturing-multiple-values/m-p/136157#M37236</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2013-11-10T16:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regex  for capturing multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-capturing-multiple-values/m-p/136158#M37237</link>
      <description>&lt;P&gt;Based on the above example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=uri "L1\=(?&amp;lt;L1&amp;gt;[\w\+\:\;\%\.]+)\&amp;amp;L2\=(?&amp;lt;L2&amp;gt;[\w\+\:\;\%\.]+)\&amp;amp;Ndr\=(?&amp;lt;Ndr&amp;gt;[\w\+\:\;\%\.]+)\&amp;amp;operator\=(?&amp;lt;operator&amp;gt;[\w\+\:\;\%\.]+)\&amp;amp;originalValue\=(?&amp;lt;originalValue&amp;gt;[\w\+\:\;\%\.]+)\&amp;amp;sst\=?&amp;lt;sst&amp;gt;\w+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 10 Nov 2013 16:31:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-capturing-multiple-values/m-p/136158#M37237</guid>
      <dc:creator>ShaneNewman</dc:creator>
      <dc:date>2013-11-10T16:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Regex  for capturing multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-capturing-multiple-values/m-p/136159#M37238</link>
      <description>&lt;P&gt;Hi the event i gave is just an example. Those parameter names would be different across different urls. So it won't work for all the urls&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2013 16:34:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-capturing-multiple-values/m-p/136159#M37238</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2013-11-10T16:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Regex  for capturing multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-capturing-multiple-values/m-p/136160#M37239</link>
      <description>&lt;P&gt;Are all of the parameter names prefixed with a &amp;amp;?&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2013 16:40:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-capturing-multiple-values/m-p/136160#M37239</guid>
      <dc:creator>ShaneNewman</dc:creator>
      <dc:date>2013-11-10T16:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Regex  for capturing multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-capturing-multiple-values/m-p/136161#M37240</link>
      <description>&lt;P&gt;props.conf&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
[yoursourcetype]&lt;BR /&gt;
KV_MODE=auto&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;this is the default... so you really should be seeing all the fields from all the queries auto extracted.&lt;/P&gt;

&lt;P&gt;As Shane is getting at... if you want to do it deliberately, it looks like you have a very clear delimiter pattern where KEY is prefixed with an ampersand, value is prefixed with an equals sign.  The exception is the first one which you could handle separately.  &lt;/P&gt;

&lt;P&gt;There are two places you want to look to understand what we're thinking.&lt;/P&gt;

&lt;P&gt;At the config level - take a look &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/Admin/Transformsconf"&gt; HERE &lt;/A&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/Admin/Transformsconf"&gt;http://docs.splunk.com/Documentation/Splunk/6.0/Admin/Transformsconf&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt; and search for "DELIM" and if you want to do it inline... then look at the various ways of handling DELIMs &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/SearchReference/CommonEvalFunctions"&gt;here &lt;/A&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/6.0/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2013 17:01:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-capturing-multiple-values/m-p/136161#M37240</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2013-11-10T17:01:27Z</dc:date>
    </item>
  </channel>
</rss>

