<?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: Referencing extracted fields from regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Referencing-extracted-fields-from-regex/m-p/71270#M17815</link>
    <description>&lt;P&gt;Yes, if you look in $SPLUNKHOME$/etc/system/default/transforms.conf, you can see many examples of how to do it.  Here is one of them:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
[octet] &lt;BR /&gt;
this would match only numbers from 0-255 (one octet in an ip)&lt;BR /&gt;
REGEX = 2(?:5[0-5]|[0-4][0-9])|[0-1][0-9][0-9]|[0-9][0-9]?&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;[ipv4]&lt;BR /&gt;
matches a valid IPv4 optionally followed by :port_num the octets in the ip would also be validated 0-255 range&lt;BR /&gt;
Extracts: ip, port&lt;BR /&gt;
REGEX = (?&lt;IP&gt;[[octet]](?:\.[[octet]]){3})(?::[[int:port]])?&lt;BR /&gt;
&lt;/IP&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 10 Jun 2012 02:57:06 GMT</pubDate>
    <dc:creator>richprescott</dc:creator>
    <dc:date>2012-06-10T02:57:06Z</dc:date>
    <item>
      <title>Referencing extracted fields from regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Referencing-extracted-fields-from-regex/m-p/71269#M17814</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;

&lt;P&gt;How would I go about referencing an already extracted field's regex pattern in a regex?&lt;BR /&gt;
So I don't have to copy the pattern of the field each time. &lt;/P&gt;

&lt;P&gt;For example I have an extracted field for "md5_hash", and I want to look for URLs with the following syntax: "^/some/thing/(md5_hash)". Is this possible?&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:55:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Referencing-extracted-fields-from-regex/m-p/71269#M17814</guid>
      <dc:creator>balidani</dc:creator>
      <dc:date>2020-09-28T11:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing extracted fields from regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Referencing-extracted-fields-from-regex/m-p/71270#M17815</link>
      <description>&lt;P&gt;Yes, if you look in $SPLUNKHOME$/etc/system/default/transforms.conf, you can see many examples of how to do it.  Here is one of them:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
[octet] &lt;BR /&gt;
this would match only numbers from 0-255 (one octet in an ip)&lt;BR /&gt;
REGEX = 2(?:5[0-5]|[0-4][0-9])|[0-1][0-9][0-9]|[0-9][0-9]?&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;[ipv4]&lt;BR /&gt;
matches a valid IPv4 optionally followed by :port_num the octets in the ip would also be validated 0-255 range&lt;BR /&gt;
Extracts: ip, port&lt;BR /&gt;
REGEX = (?&lt;IP&gt;[[octet]](?:\.[[octet]]){3})(?::[[int:port]])?&lt;BR /&gt;
&lt;/IP&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jun 2012 02:57:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Referencing-extracted-fields-from-regex/m-p/71270#M17815</guid>
      <dc:creator>richprescott</dc:creator>
      <dc:date>2012-06-10T02:57:06Z</dc:date>
    </item>
  </channel>
</rss>

