<?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: What is the proper regex syntax to use rex to create 4 new fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-proper-regex-syntax-to-use-rex-to-create-4-new/m-p/141770#M39298</link>
    <description>&lt;P&gt;/apps/IHSLogs/com-ihs85-pd01-01/&lt;STRONG&gt;IRX&lt;/STRONG&gt;WebCommon/access_log_2018-11-16&lt;/P&gt;

&lt;P&gt;how to extract this field &lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 22:00:21 GMT</pubDate>
    <dc:creator>abhay1991</dc:creator>
    <dc:date>2020-09-29T22:00:21Z</dc:date>
    <item>
      <title>What is the proper regex syntax to use rex to create 4 new fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-proper-regex-syntax-to-use-rex-to-create-4-new/m-p/141767#M39295</link>
      <description>&lt;P&gt;I have a log line that looks like the following:&lt;/P&gt;

&lt;P&gt;2014-11-28 19:28:42 smx02 postfix/smtp[57736]: 6F7471C73AC_479133AF: to=, relay=127.0.0.1[127.0.0.1]:10025, delay=0.13, delays=0.01/0/0/0.12, dsn=2.0.0, status=sent (250 OK, sent 5479133A_6994_12793_1 8E560172844_479133AB)&lt;/P&gt;

&lt;P&gt;I want to use regex to create 4 new fields.&lt;/P&gt;

&lt;P&gt;Field1 - 6F7471C73AC_479133AF (number/letter combinations)&lt;BR /&gt;
Field2 - 5479133A_6994_12793_1 (number/letter combinations)&lt;BR /&gt;
Field3 - 8E560172844_479133AB (number/letter combinations)&lt;BR /&gt;
Field 4 - 57736 (Always  number)&lt;/P&gt;

&lt;P&gt;I know I can use the rex field=FIELDNAME command, but I can't seem to get the syntax to work.&lt;/P&gt;

&lt;P&gt;Is there anyone that can point me in the right direction or give me some times on how to create these fields. I really just want to understand the Splunk syntax.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:18:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-proper-regex-syntax-to-use-rex-to-create-4-new/m-p/141767#M39295</guid>
      <dc:creator>akelly4</dc:creator>
      <dc:date>2020-09-28T18:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: What is the proper regex syntax to use rex to create 4 new fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-proper-regex-syntax-to-use-rex-to-create-4-new/m-p/141768#M39296</link>
      <description>&lt;P&gt;For problems like this, &lt;A href="http://www.regexr.com/"&gt;RegExr&lt;/A&gt; is a great tool.  Using it and your sample event, I came up with this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "\[(?&amp;lt;Field4&amp;gt;\d+)]:\s+(?&amp;lt;Field1&amp;gt;\S+):[\s\S]+?, sent (?&amp;lt;Field2&amp;gt;\S+) (?&amp;lt;Field3&amp;gt;\S+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Dec 2014 19:48:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-proper-regex-syntax-to-use-rex-to-create-4-new/m-p/141768#M39296</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-12-02T19:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: What is the proper regex syntax to use rex to create 4 new fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-proper-regex-syntax-to-use-rex-to-create-4-new/m-p/141769#M39297</link>
      <description>&lt;P&gt;Also, here's a previous Answers posts with a collection of users' favorite resources for regex help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/153171/is-there-any-online-regex-tool-to-create-regular-e.html"&gt;http://answers.splunk.com/answers/153171/is-there-any-online-regex-tool-to-create-regular-e.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2014 20:06:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-proper-regex-syntax-to-use-rex-to-create-4-new/m-p/141769#M39297</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2014-12-02T20:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: What is the proper regex syntax to use rex to create 4 new fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-proper-regex-syntax-to-use-rex-to-create-4-new/m-p/141770#M39298</link>
      <description>&lt;P&gt;/apps/IHSLogs/com-ihs85-pd01-01/&lt;STRONG&gt;IRX&lt;/STRONG&gt;WebCommon/access_log_2018-11-16&lt;/P&gt;

&lt;P&gt;how to extract this field &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:00:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-proper-regex-syntax-to-use-rex-to-create-4-new/m-p/141770#M39298</guid>
      <dc:creator>abhay1991</dc:creator>
      <dc:date>2020-09-29T22:00:21Z</dc:date>
    </item>
  </channel>
</rss>

