<?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 Regex: How to extract multiple fields with the same name? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-How-to-extract-multiple-fields-with-the-same-name/m-p/287549#M87047</link>
    <description>&lt;P&gt;Here is an example of the log I am dealing with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;123 Main St&amp;gt;
&amp;lt;456 Center St.&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'd like to simply extract the names and addresses as seen below, but I'm not sure how to deal with the fields having the same name for different people.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sender Name    Sender Address     Receiver Name     Receiver Address
John Doe       123 Main St.       Jane Doe          456 Center St.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 Apr 2016 17:36:33 GMT</pubDate>
    <dc:creator>olheiser01</dc:creator>
    <dc:date>2016-04-11T17:36:33Z</dc:date>
    <item>
      <title>Regex: How to extract multiple fields with the same name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-How-to-extract-multiple-fields-with-the-same-name/m-p/287549#M87047</link>
      <description>&lt;P&gt;Here is an example of the log I am dealing with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;123 Main St&amp;gt;
&amp;lt;456 Center St.&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'd like to simply extract the names and addresses as seen below, but I'm not sure how to deal with the fields having the same name for different people.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sender Name    Sender Address     Receiver Name     Receiver Address
John Doe       123 Main St.       Jane Doe          456 Center St.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Apr 2016 17:36:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-How-to-extract-multiple-fields-with-the-same-name/m-p/287549#M87047</guid>
      <dc:creator>olheiser01</dc:creator>
      <dc:date>2016-04-11T17:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: How to extract multiple fields with the same name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-How-to-extract-multiple-fields-with-the-same-name/m-p/287550#M87048</link>
      <description>&lt;P&gt;I think we need more information.  Your sample log has only an address so how is it identified as Sender Address or Receiver Address?  Where do the names come from?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 17:47:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-How-to-extract-multiple-fields-with-the-same-name/m-p/287550#M87048</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-04-11T17:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: How to extract multiple fields with the same name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-How-to-extract-multiple-fields-with-the-same-name/m-p/287551#M87049</link>
      <description>&lt;P&gt;There was definitely a typo some where. Here is what I meant to ask:&lt;/P&gt;

&lt;P&gt;Here is an example of the log I am dealing with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;send-customer&amp;gt;&amp;lt;full-name&amp;gt;&amp;lt;John Doe&amp;gt;&amp;lt;/full-name&amp;gt;&amp;lt;address&amp;gt;&amp;lt;123 Main St&amp;gt;&amp;lt;/address&amp;gt;&amp;lt;/send-customer&amp;gt;
&amp;lt;receive-customer&amp;gt;&amp;lt;full-name&amp;gt;&amp;lt;Jane Doe&amp;gt;&amp;lt;/full-name&amp;gt;&amp;lt;address&amp;gt;&amp;lt;456 Center St.&amp;gt;&amp;lt;/address&amp;gt;&amp;lt;/receive-customer&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'd like to simply extract the names and addresses as seen below but Im not sure how to deal with the fields having the same name for different people.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;**Sender Name    Sender Address        Receiver Name     Receiver Address**
John Doe           123 Main St.               Jane Doe                456 Center St.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Apr 2016 17:50:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-How-to-extract-multiple-fields-with-the-same-name/m-p/287551#M87049</guid>
      <dc:creator>olheiser01</dc:creator>
      <dc:date>2016-04-11T17:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: How to extract multiple fields with the same name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-How-to-extract-multiple-fields-with-the-same-name/m-p/287552#M87050</link>
      <description>&lt;P&gt;The spath command will create fields with different names: send-customer.address, receive-customer.address, etc.  However, spath doesn't work with your data since the values look like tags with angle brackets around them.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 18:19:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-How-to-extract-multiple-fields-with-the-same-name/m-p/287552#M87050</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-04-11T18:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: How to extract multiple fields with the same name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-How-to-extract-multiple-fields-with-the-same-name/m-p/287553#M87051</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "\&amp;lt;send-customer\&amp;gt;\&amp;lt;full-name\&amp;gt;\&amp;lt;(?&amp;lt;SenderName&amp;gt;[^\&amp;gt;]+)\&amp;gt;\&amp;lt;\/full-name\&amp;gt;\&amp;lt;address\&amp;gt;\&amp;lt;(?&amp;lt;SenderAddress&amp;gt;[^\&amp;gt;]+)\&amp;gt;\&amp;lt;\/address\&amp;gt;\&amp;lt;\/send-customer\&amp;gt;"  | rex "\&amp;lt;receive-customer\&amp;gt;\&amp;lt;full-name\&amp;gt;\&amp;lt;(?&amp;lt;ReceiverName&amp;gt;[^\&amp;gt;]+)\&amp;gt;\&amp;lt;\/full-name\&amp;gt;\&amp;lt;address\&amp;gt;\&amp;lt;(?&amp;lt;ReceiverAddress&amp;gt;[^\&amp;gt;]+)\&amp;gt;\&amp;lt;\/address\&amp;gt;\&amp;lt;\/receive-customer\&amp;gt;"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Apr 2016 18:22:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-How-to-extract-multiple-fields-with-the-same-name/m-p/287553#M87051</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-04-11T18:22:59Z</dc:date>
    </item>
  </channel>
</rss>

