<?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: Field Extraction from Regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-from-Regex/m-p/46362#M11095</link>
    <description>&lt;P&gt;It does happen automagically, but you can make any sourcetype extract the same fields with the transform. start taking a look at props.conf, and transforms.conf for general iis field extractions.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Nov 2012 15:08:17 GMT</pubDate>
    <dc:creator>tmarlette</dc:creator>
    <dc:date>2012-11-29T15:08:17Z</dc:date>
    <item>
      <title>Field Extraction from Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-from-Regex/m-p/46356#M11089</link>
      <description>&lt;P&gt;So I am relatively new to extracting fields in Splunk, but I have some knowledge of regex, and I'm attempting to apply it in Splunk. &lt;/P&gt;

&lt;P&gt;I have a pattern I am attempting to extract and put into a field. The pattern looks like this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;USER@TEST 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am using this expression to match the pattern:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(\w+@\w+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to extract this into a field called "user_domain", and I'm having some difficulty renaming &lt;CODE&gt;(\w+@\w+)&lt;/CODE&gt; as "&lt;CODE&gt;user_domain&lt;/CODE&gt;". &lt;/P&gt;

&lt;P&gt;PS... this forum doesn't show forward slashes, however they are there. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:47:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-from-Regex/m-p/46356#M11089</guid>
      <dc:creator>tmarlette</dc:creator>
      <dc:date>2020-09-28T11:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-from-Regex/m-p/46357#M11090</link>
      <description>&lt;P&gt;What ways did you try? You could make use of the &lt;CODE&gt;rex&lt;/CODE&gt; command, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "(?&amp;lt;user_domain&amp;gt;\w+@\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or you could make this kind of extraction permanent by using the interactive field extractor (&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/User/InteractiveFieldExtractionExample"&gt;http://docs.splunk.com/Documentation/Splunk/latest/User/InteractiveFieldExtractionExample&lt;/A&gt; ).&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 21:09:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-from-Regex/m-p/46357#M11090</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-05-08T21:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-from-Regex/m-p/46358#M11091</link>
      <description>&lt;P&gt;Actually... I didn't try that at all.&lt;/P&gt;

&lt;P&gt;&amp;lt;--- Shamed &lt;/P&gt;

&lt;P&gt;| rex "(?&lt;USER_DOMAIN&gt;\w+@\w+)"&lt;BR /&gt;
that worked splendidly, thank you! &lt;/USER_DOMAIN&gt;&lt;/P&gt;

&lt;P&gt;I did try the interactive extractor though, but it won't extract everything I needed it to. &lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 22:04:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-from-Regex/m-p/46358#M11091</guid>
      <dc:creator>tmarlette</dc:creator>
      <dc:date>2012-05-08T22:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-from-Regex/m-p/46359#M11092</link>
      <description>&lt;P&gt;By curiosity, are you trying to extract apache logs or IIS logs ?&lt;/P&gt;

&lt;P&gt;Existing sourcetypes provide automatic extraction :&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;access_combined for apache logs&lt;/LI&gt;
&lt;LI&gt;iis for iis logs, you have several options, use this guide to define your columns &lt;A href="http://splunk-base.splunk.com/answers/1902/iis-and-exchange-log-header-extraction"&gt;http://splunk-base.splunk.com/answers/1902/iis-and-exchange-log-header-extraction&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 08 May 2012 22:08:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-from-Regex/m-p/46359#M11092</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2012-05-08T22:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-from-Regex/m-p/46360#M11093</link>
      <description>&lt;P&gt;Negative yannK, These are proprietary log messages that I'm attempting to scrub. &lt;/P&gt;

&lt;P&gt;But to make sure I understand you correctly, because we do have apache and iis logs here as well, if I name my sourcetype "access_combined" and send my iss / apache logs there, Splunk will extract a set of fields auto-magically? &lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 22:11:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-from-Regex/m-p/46360#M11093</guid>
      <dc:creator>tmarlette</dc:creator>
      <dc:date>2012-05-08T22:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-from-Regex/m-p/46361#M11094</link>
      <description>&lt;P&gt;yes, some sourcetypes are defined and provide automatic field extractions. look for : syslog, access_combined and apache_errors ...&lt;/P&gt;

&lt;P&gt;see &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.2/Data/Listofpretrainedsourcetypes" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.2/Data/Listofpretrainedsourcetypes&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:47:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-from-Regex/m-p/46361#M11094</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2020-09-28T11:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction from Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-from-Regex/m-p/46362#M11095</link>
      <description>&lt;P&gt;It does happen automagically, but you can make any sourcetype extract the same fields with the transform. start taking a look at props.conf, and transforms.conf for general iis field extractions.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2012 15:08:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-from-Regex/m-p/46362#M11095</guid>
      <dc:creator>tmarlette</dc:creator>
      <dc:date>2012-11-29T15:08:17Z</dc:date>
    </item>
  </channel>
</rss>

