<?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: Use named backreference in the subsequent rex command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Use-named-backreference-in-the-subsequent-rex-command/m-p/166969#M47521</link>
    <description>&lt;P&gt;Not exactly what you're asking, but you can use \n to represent a previously captured group in the same rex command.  So in your case, something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "&amp;lt;tag1&amp;gt;(?P&amp;lt;NamedField1&amp;gt;[^&amp;lt;]+").+&amp;lt;tag2&amp;gt;\1&amp;lt;/tag2&amp;gt;&amp;lt;tag3&amp;gt;(?P&amp;lt;NamedField2&amp;gt;)" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Although I'm pretty sure i found a way to substitute field names in the rex too, but don't remember and could be mistaken.  &lt;/P&gt;</description>
    <pubDate>Thu, 13 Aug 2015 01:53:00 GMT</pubDate>
    <dc:creator>maciep</dc:creator>
    <dc:date>2015-08-13T01:53:00Z</dc:date>
    <item>
      <title>Use named backreference in the subsequent rex command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-named-backreference-in-the-subsequent-rex-command/m-p/166968#M47520</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;Can you let me know how we can use a named backreference in the subsequent rex command? That is pass the value of the named backreference to the next rex command.&lt;/P&gt;

&lt;P&gt;I am trying something like below which is not providing the desired result.&lt;/P&gt;

&lt;P&gt;rex "&amp;lt;tag1&amp;gt;(?P&amp;lt;NamedField1&amp;gt;[^&amp;lt;]+" | rex "&amp;lt;tag2&amp;gt;?(P=NamedField1)&amp;lt;/tag2&amp;gt;&amp;lt;tag3&amp;gt;(?P&amp;lt;NamedField2&amp;gt;)" | table NamedField2&lt;/P&gt;

&lt;P&gt;If someone could point out some documentation around this that would be very helpful.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2015 12:00:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-named-backreference-in-the-subsequent-rex-command/m-p/166968#M47520</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2015-08-12T12:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Use named backreference in the subsequent rex command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-named-backreference-in-the-subsequent-rex-command/m-p/166969#M47521</link>
      <description>&lt;P&gt;Not exactly what you're asking, but you can use \n to represent a previously captured group in the same rex command.  So in your case, something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "&amp;lt;tag1&amp;gt;(?P&amp;lt;NamedField1&amp;gt;[^&amp;lt;]+").+&amp;lt;tag2&amp;gt;\1&amp;lt;/tag2&amp;gt;&amp;lt;tag3&amp;gt;(?P&amp;lt;NamedField2&amp;gt;)" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Although I'm pretty sure i found a way to substitute field names in the rex too, but don't remember and could be mistaken.  &lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2015 01:53:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-named-backreference-in-the-subsequent-rex-command/m-p/166969#M47521</guid>
      <dc:creator>maciep</dc:creator>
      <dc:date>2015-08-13T01:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Use named backreference in the subsequent rex command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-named-backreference-in-the-subsequent-rex-command/m-p/166970#M47522</link>
      <description>&lt;P&gt;Thanks maciep.&lt;/P&gt;

&lt;P&gt;I had this option, but unfortunately the xml structure is quite redundant and complex which would not allow using a single rex command. Nevertheless, I had found some workaround with eval command.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2015 05:13:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-named-backreference-in-the-subsequent-rex-command/m-p/166970#M47522</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2015-08-28T05:13:23Z</dc:date>
    </item>
  </channel>
</rss>

