<?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: How to configure regex in transforms.conf to extract values for a field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-regex-in-transforms-conf-to-extract-values-for/m-p/280036#M84537</link>
    <description>&lt;P&gt;The extracted field names can't have spaces. So replace space with underscore in REGEX and try again.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Feb 2016 17:24:47 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-02-12T17:24:47Z</dc:date>
    <item>
      <title>How to configure regex in transforms.conf to extract values for a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-regex-in-transforms-conf-to-extract-values-for/m-p/280031#M84532</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am attempting to figure out a regex for a transforms.conf for a field named &lt;STRONG&gt;Call Reason&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Example data looks like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;A - Call plan question
B - Data plan question
C - Cellular telephone function question
D - Weak call signal
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My goal is to transform the Call Reason field to eliminate the first 4 characters (Alpha space - space) of each row so the it shows as&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Call plan question
Data plan question
Cellular telephone function question
Weak call signal
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help is deeply appreciated as I am very weak in REGEX.&lt;/P&gt;

&lt;P&gt;Many thanks&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 20:30:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-regex-in-transforms-conf-to-extract-values-for/m-p/280031#M84532</guid>
      <dc:creator>TheJagoff</dc:creator>
      <dc:date>2016-02-11T20:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure regex in transforms.conf to extract values for a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-regex-in-transforms-conf-to-extract-values-for/m-p/280032#M84533</link>
      <description>&lt;P&gt;You can do this either by using calculated field (in props.conf only) OR transforms.conf both.&lt;/P&gt;

&lt;P&gt;Calculated field - props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yourSourcetype]
EVAL-field=substr(YourFieldName,5)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Transform&lt;BR /&gt;
props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yourSourcetype]
REPORT-field = mytransform
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mytransform]
SOURCE_KEY = YourFieldName
REGEX = ^(.{4})(?&amp;lt;YourFieldName&amp;gt;.+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To see these regex/function working in search, see this run anywhere sample&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 | eval Reason="A - Call plan question." | table Reason| rex field=Reason "^.{4}(?&amp;lt;Field&amp;gt;.+)" | eval Field2=substr(Reason,5)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Feb 2016 21:19:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-regex-in-transforms-conf-to-extract-values-for/m-p/280032#M84533</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-11T21:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure regex in transforms.conf to extract values for a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-regex-in-transforms-conf-to-extract-values-for/m-p/280033#M84534</link>
      <description>&lt;P&gt;Hey, thanks for the reply, I got called away and will look into this tomorrow morning. Thanks again.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 23:54:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-regex-in-transforms-conf-to-extract-values-for/m-p/280033#M84534</guid>
      <dc:creator>TheJagoff</dc:creator>
      <dc:date>2016-02-11T23:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure regex in transforms.conf to extract values for a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-regex-in-transforms-conf-to-extract-values-for/m-p/280034#M84535</link>
      <description>&lt;P&gt;Hey, I ran the anywhere sample and it worked, however, when I put it in the transforms.conf and restarted I got the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Checking conf files for problems...
Bad regex value: '^(.{4})(?&amp;lt;Call Reason&amp;gt;.+)', of param: transforms.conf / [trans-callreason] / REGEX; why: syntax error in subpattern name (missing terminator)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in my props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REPORT-field = trans-callreason
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[trans-callreason]
SOURCE_KEY = "Call Reason"
REGEX = ^(.{4})(?.+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'll start looking into this error but please cut in if it's an obvious error on my part.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 14:07:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-regex-in-transforms-conf-to-extract-values-for/m-p/280034#M84535</guid>
      <dc:creator>TheJagoff</dc:creator>
      <dc:date>2016-02-12T14:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure regex in transforms.conf to extract values for a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-regex-in-transforms-conf-to-extract-values-for/m-p/280035#M84536</link>
      <description>&lt;P&gt;Call Reason is not showing in this forum when I typed it into the REGEX statement...&lt;/P&gt;

&lt;P&gt;But that is what I have between the (?&amp;lt; and  the &amp;gt;.+)&lt;/P&gt;

&lt;P&gt;Sorry for being confusing...&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 15:06:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-regex-in-transforms-conf-to-extract-values-for/m-p/280035#M84536</guid>
      <dc:creator>TheJagoff</dc:creator>
      <dc:date>2016-02-12T15:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure regex in transforms.conf to extract values for a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-regex-in-transforms-conf-to-extract-values-for/m-p/280036#M84537</link>
      <description>&lt;P&gt;The extracted field names can't have spaces. So replace space with underscore in REGEX and try again.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 17:24:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-regex-in-transforms-conf-to-extract-values-for/m-p/280036#M84537</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-12T17:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure regex in transforms.conf to extract values for a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-regex-in-transforms-conf-to-extract-values-for/m-p/280037#M84538</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
You are absolutely correct - no spaces. Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 13 Feb 2016 19:15:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-regex-in-transforms-conf-to-extract-values-for/m-p/280037#M84538</guid>
      <dc:creator>TheJagoff</dc:creator>
      <dc:date>2016-02-13T19:15:36Z</dc:date>
    </item>
  </channel>
</rss>

