<?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 Backreferences in Fieldnames of rex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Backreferences-in-Fieldnames-of-rex/m-p/565510#M197046</link>
    <description>&lt;P&gt;Hey There,&lt;/P&gt;&lt;P&gt;i have n Systems.&lt;/P&gt;&lt;P&gt;I would like to apply a rex query, where each fieldname contains the system ID which i have to extract from the logs too.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... | rex field=_raw "System(\d+)\sFailure\sRate\s(?&amp;lt;system_\1_failurerate&amp;gt;\d*)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately backreferencing for field name seems not to be supported.&lt;/P&gt;&lt;P&gt;Has anyone an idea? It needs to be added in a TA afterwards, hence eval etc. are not applicable&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Sep 2021 15:27:22 GMT</pubDate>
    <dc:creator>SaltyHash123</dc:creator>
    <dc:date>2021-09-01T15:27:22Z</dc:date>
    <item>
      <title>Backreferences in Fieldnames of rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Backreferences-in-Fieldnames-of-rex/m-p/565510#M197046</link>
      <description>&lt;P&gt;Hey There,&lt;/P&gt;&lt;P&gt;i have n Systems.&lt;/P&gt;&lt;P&gt;I would like to apply a rex query, where each fieldname contains the system ID which i have to extract from the logs too.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... | rex field=_raw "System(\d+)\sFailure\sRate\s(?&amp;lt;system_\1_failurerate&amp;gt;\d*)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately backreferencing for field name seems not to be supported.&lt;/P&gt;&lt;P&gt;Has anyone an idea? It needs to be added in a TA afterwards, hence eval etc. are not applicable&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 15:27:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Backreferences-in-Fieldnames-of-rex/m-p/565510#M197046</guid>
      <dc:creator>SaltyHash123</dc:creator>
      <dc:date>2021-09-01T15:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Backreferences in Fieldnames of rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Backreferences-in-Fieldnames-of-rex/m-p/565555#M197056</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex field=_raw "System(?&amp;lt;number&amp;gt;\d+)\sFailure\sRate\s(?&amp;lt;system_failurerate&amp;gt;\d*)"
| eval system_{number}_failurerate=system_failurerate&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 01 Sep 2021 20:55:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Backreferences-in-Fieldnames-of-rex/m-p/565555#M197056</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-09-01T20:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Backreferences in Fieldnames of rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Backreferences-in-Fieldnames-of-rex/m-p/566075#M197251</link>
      <description>&lt;P&gt;It works but i forgot to mention, that each log can have multiple matches. This solution will only find the first match in the logs&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 07:44:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Backreferences-in-Fieldnames-of-rex/m-p/566075#M197251</guid>
      <dc:creator>SaltyHash123</dc:creator>
      <dc:date>2021-09-07T07:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Backreferences in Fieldnames of rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Backreferences-in-Fieldnames-of-rex/m-p/566078#M197252</link>
      <description>&lt;P&gt;Perhaps if you could share an anonymised example log entry or two - please use code block &amp;lt;/&amp;gt; to share it&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 07:47:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Backreferences-in-Fieldnames-of-rex/m-p/566078#M197252</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-09-07T07:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Backreferences in Fieldnames of rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Backreferences-in-Fieldnames-of-rex/m-p/566083#M197256</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SystemR1 Failure Rate 17
System2 Failure Rate 3&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I held the whole example abstract as i can't even share anonymized data &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;making a rex like the following one will match the first row with system R1 but ignore system 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw "System(?&amp;lt;id&amp;gt;R?\d)\sFailure\sRate\s(?&amp;lt;rate&amp;gt;\d+)
| eval system_{id}_failure = rate&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;using multivalues is also not possible, as this will be used as a transform in a globally available TA&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 08:14:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Backreferences-in-Fieldnames-of-rex/m-p/566083#M197256</guid>
      <dc:creator>SaltyHash123</dc:creator>
      <dc:date>2021-09-07T08:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Backreferences in Fieldnames of rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Backreferences-in-Fieldnames-of-rex/m-p/566100#M197265</link>
      <description>&lt;P&gt;How about modifying the text into xml and extracting the fields that way&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="SystemR1 Failure Rate 17
System2 Failure Rate 3"
| rex mode=sed "s/(?&amp;lt;system&amp;gt;System.+\sFailure\sRate) (?&amp;lt;rate&amp;gt;\d+)/&amp;lt;\1&amp;gt;\2&amp;lt;\/\1&amp;gt;/g s/\s+/_/g"
| spath&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 07 Sep 2021 09:28:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Backreferences-in-Fieldnames-of-rex/m-p/566100#M197265</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-09-07T09:28:40Z</dc:date>
    </item>
  </channel>
</rss>

