<?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: Extract Multiple Fields with Regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-Multiple-Fields-with-Regex/m-p/143739#M39946</link>
    <description>&lt;P&gt;Thanks for the prompt answer. &lt;BR /&gt;
This helped me to extract multiple fields. But can I also somehow append "req" to each field automatically ?&lt;/P&gt;</description>
    <pubDate>Fri, 05 Dec 2014 03:01:39 GMT</pubDate>
    <dc:creator>ryoji_solsys</dc:creator>
    <dc:date>2014-12-05T03:01:39Z</dc:date>
    <item>
      <title>Extract Multiple Fields with Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Multiple-Fields-with-Regex/m-p/143737#M39944</link>
      <description>&lt;P&gt;I would like to extract fields in the response field dynamically by using "&amp;lt;_KEY_1" "&amp;lt;_VAL_1&amp;gt;" in transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;response = "customer:{tel:123456} startpoint:{http://www.splunk.com} interfaceNumber:{1234} name:{abc}"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ideally I want to generate fields as&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;response-customer-tel = 123456
response-startpoint = http://www.splunk.com
response-interfacenumber = 1234 
response-name = abc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have the following regex.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;response=.+ (?&amp;lt;_KEY_1&amp;gt;\w+)\:\{(?&amp;lt;_VAL_1&amp;gt;.+)\}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I only get the last field "name" = "abc" extracted.&lt;/P&gt;

&lt;P&gt;What is the best way to extract multi-fields dynamically by using &lt;EM&gt;KEY&lt;/EM&gt; and &lt;EM&gt;VAL&lt;/EM&gt;. (I don't know how many entries the response field has since each event can have a different number of entries in the response field).&lt;BR /&gt;
I would also like to extract fields in a way that append "response" to each field so that it says response-name, response-interfacenumber and so on... &lt;BR /&gt;
I learned that I can use "FIELDALIAS" to modify the field names from the previous question but is there anyway I can append "request" to the extracted fields automatically ?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:19:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Multiple-Fields-with-Regex/m-p/143737#M39944</guid>
      <dc:creator>ryoji_solsys</dc:creator>
      <dc:date>2020-09-28T18:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Multiple Fields with Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Multiple-Fields-with-Regex/m-p/143738#M39945</link>
      <description>&lt;P&gt;Try to use this Regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?P&amp;lt;_KEY_1&amp;gt;\w+):\{(?P&amp;lt;_VAL_1&amp;gt;[^\s]+)\}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I haven't tested in Splunk but tested in &lt;A href="https://regex101.com/"&gt;https://regex101.com/&lt;/A&gt; and seems fine&lt;/P&gt;

&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Fri, 05 Dec 2014 02:25:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Multiple-Fields-with-Regex/m-p/143738#M39945</guid>
      <dc:creator>musskopf</dc:creator>
      <dc:date>2014-12-05T02:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Multiple Fields with Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Multiple-Fields-with-Regex/m-p/143739#M39946</link>
      <description>&lt;P&gt;Thanks for the prompt answer. &lt;BR /&gt;
This helped me to extract multiple fields. But can I also somehow append "req" to each field automatically ?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Dec 2014 03:01:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Multiple-Fields-with-Regex/m-p/143739#M39946</guid>
      <dc:creator>ryoji_solsys</dc:creator>
      <dc:date>2014-12-05T03:01:39Z</dc:date>
    </item>
  </channel>
</rss>

