<?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: Why am I not seeing any fields extracted with my REGEX in transforms.conf? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189163#M54507</link>
    <description>&lt;P&gt;And that's a no.. didn't happen.&lt;/P&gt;

&lt;P&gt;Starting to think it's not picking up the transform config.&lt;/P&gt;

&lt;P&gt;Though I have other transforms configured in the same files that work just fine, so I can't really see what the problem should be there. But I'll go through it all word for word, check I didn't miss a spelling error or something...&lt;/P&gt;

&lt;P&gt;The regex itself works fine if I use it at search time, so that should not be the problem.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Mar 2015 22:30:03 GMT</pubDate>
    <dc:creator>reedmohn</dc:creator>
    <dc:date>2015-03-19T22:30:03Z</dc:date>
    <item>
      <title>Why am I not seeing any fields extracted with my REGEX in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189154#M54498</link>
      <description>&lt;P&gt;At the risk of once again displaying my ignorance...&lt;BR /&gt;
I added this transform regex to transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myformat]
REGEX = ^.*\[(?.*?)\]\s(?[A-Z]+)\s+(?\S+\s\S+)\s\-\s(?.+)$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also tried this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = \[(?.*?)\]\s(?[A-Z]+)\s+(?\S+\s\S+)\s\-\s(?.+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Props.conf has:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mylog]
....
...
TRANFORMS-mylog_format = myformat
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;They're supposed to match log lines like this, but I'm not seeing any fields extracted:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-07-31 23:57:51,858 [26] INFO  MyApp.Service.Logger.Filter - Number not in range
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The format is:    timestamp [THREAD] LEVEL  LOGGER - Message&lt;/P&gt;

&lt;P&gt;The regex itself works with rex in search, but not here, and now I'm staring myself blind on something obvious, I'm sure....&lt;/P&gt;

&lt;P&gt;Any advice?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2015 22:27:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189154#M54498</guid>
      <dc:creator>reedmohn</dc:creator>
      <dc:date>2015-03-18T22:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not seeing any fields extracted with my REGEX in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189155#M54499</link>
      <description>&lt;P&gt;..and before you ask:  no, I am not in Fast Mode &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2015 22:34:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189155#M54499</guid>
      <dc:creator>reedmohn</dc:creator>
      <dc:date>2015-03-18T22:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not seeing any fields extracted with my REGEX in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189156#M54500</link>
      <description>&lt;P&gt;you have to have a capturing group within your regex. each capturing group would correspond to a field. You can specify the capturing groups in your transforms.conf like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myformat]
REGEX = ^.*\[(?.*?)\]\s(?[A-Z]+)\s+(?\S+\s\S+)\s\-\s(?.+)$
FORMAT =  field_1::$1 field_2::$2 field_3::$3 field_4::$4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;edit: I assumued your regex works for you. (didn't check)&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2015 22:37:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189156#M54500</guid>
      <dc:creator>sk314</dc:creator>
      <dc:date>2015-03-18T22:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not seeing any fields extracted with my REGEX in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189157#M54501</link>
      <description>&lt;P&gt;Need to use inline captures as mentioned:&lt;/P&gt;

&lt;P&gt;In this example, I am not using the form setting, but instead doing an inline capture in the regex and defining the fields there.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysource]
REGEX  = ^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} \[(?&amp;lt;capture1&amp;gt;\d+)\]\s+(?&amp;lt;sysloglevel&amp;gt;\w+)\s+(?&amp;lt;ApplicationName&amp;gt;[^\s]+)\s+\-\s+(?&amp;lt;message_body&amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Mar 2015 23:13:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189157#M54501</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2015-03-18T23:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not seeing any fields extracted with my REGEX in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189158#M54502</link>
      <description>&lt;P&gt;Ahh... sorry, the editor here screwed up my string before I edited in the code section. The field labels were edited out as HTML, I guess. These are the actual expressions I used:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = ^.*\[(?&amp;lt;thread&amp;gt;.*?)\]\s(?&amp;lt;level&amp;gt;[A-Z]+)\s+(?&amp;lt;logger&amp;gt;\S+\s\S+)\s\-\s(?&amp;lt;message&amp;gt;.+)$

REGEX = \[(?&amp;lt;thread&amp;gt;.*?)\]\s(?&amp;lt;level&amp;gt;[A-Z]+)\s+(?&amp;lt;logger&amp;gt;\S+\s\S+)\s\-\s(?&amp;lt;message&amp;gt;.+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Mar 2015 21:03:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189158#M54502</guid>
      <dc:creator>reedmohn</dc:creator>
      <dc:date>2015-03-19T21:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not seeing any fields extracted with my REGEX in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189159#M54503</link>
      <description>&lt;P&gt;Thanks, but I see I got the formatting wrong in the OP. See answer below.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2015 21:04:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189159#M54503</guid>
      <dc:creator>reedmohn</dc:creator>
      <dc:date>2015-03-19T21:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not seeing any fields extracted with my REGEX in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189160#M54504</link>
      <description>&lt;P&gt;That's pretty much what I tried, too (see below).  The capture labels got lost in the editor here...&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2015 21:05:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189160#M54504</guid>
      <dc:creator>reedmohn</dc:creator>
      <dc:date>2015-03-19T21:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not seeing any fields extracted with my REGEX in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189161#M54505</link>
      <description>&lt;P&gt;Could you try removing the name capture group and using the FORMAT line? &lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2015 21:50:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189161#M54505</guid>
      <dc:creator>sk314</dc:creator>
      <dc:date>2015-03-19T21:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not seeing any fields extracted with my REGEX in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189162#M54506</link>
      <description>&lt;P&gt;Yup.. working on that right now.. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2015 21:55:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189162#M54506</guid>
      <dc:creator>reedmohn</dc:creator>
      <dc:date>2015-03-19T21:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not seeing any fields extracted with my REGEX in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189163#M54507</link>
      <description>&lt;P&gt;And that's a no.. didn't happen.&lt;/P&gt;

&lt;P&gt;Starting to think it's not picking up the transform config.&lt;/P&gt;

&lt;P&gt;Though I have other transforms configured in the same files that work just fine, so I can't really see what the problem should be there. But I'll go through it all word for word, check I didn't miss a spelling error or something...&lt;/P&gt;

&lt;P&gt;The regex itself works fine if I use it at search time, so that should not be the problem.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2015 22:30:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189163#M54507</guid>
      <dc:creator>reedmohn</dc:creator>
      <dc:date>2015-03-19T22:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not seeing any fields extracted with my REGEX in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189164#M54508</link>
      <description>&lt;P&gt;just checking, do you have the corresponding props.conf entry?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2015 22:36:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189164#M54508</guid>
      <dc:creator>sk314</dc:creator>
      <dc:date>2015-03-19T22:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not seeing any fields extracted with my REGEX in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189165#M54509</link>
      <description>&lt;P&gt;Your regex's are wrong. Remember to include your timestamp pattern as the event includes this. A greedy match with your regex doesnt work properly.&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    \d{4}\-\d{2}\-\d{2}\s\d{2}\:\d{2}\:\d{2}\,\d{3} \[(?&amp;lt;first&amp;gt;\d+)\] (?&amp;lt;second&amp;gt;\w+)\s+(?&amp;lt;third&amp;gt;[^\s]+)\s\-\s+(?&amp;lt;fourth&amp;gt;.*)
OR

^.*\[(?&amp;lt;first&amp;gt;\d+)\] (?&amp;lt;second&amp;gt;\w+)\s+(?&amp;lt;third&amp;gt;[^\s]+)\s\-\s+(?&amp;lt;fourth&amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysource]
REPORT-mysource = mysource-extract
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysource-extract]
REGEX = \d{4}\-\d{2}\-\d{2}\s\d{2}\:\d{2}\:\d{2}\,\d{3} \[(?&amp;lt;first&amp;gt;\d+)\] (?&amp;lt;second&amp;gt;\w+)\s+(?&amp;lt;third&amp;gt;[^\s]+)\s\-\s+(?&amp;lt;fourth&amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Mar 2015 22:47:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189165#M54509</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2015-03-19T22:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not seeing any fields extracted with my REGEX in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189166#M54510</link>
      <description>&lt;P&gt;Here's the full props entry:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[log4net]
pulldown_type = true
MAX_TIMESTAMP_LOOKAHEAD = 32
SHOULD_LINEMERGE = True
BREAK_ONLY_BEFORE_DATE = True
CHECK_FOR_HEADER = False
TRANSFORMS-log4net_events = log4net_format
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the current transform:&lt;/P&gt;

&lt;P&gt;[log4net_format]&lt;BR /&gt;
REGEX = ^.&lt;EM&gt;[(?\d+)] (?\w+)\s+(?.+)\s-\s+(?.&lt;/EM&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2015 11:42:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189166#M54510</guid>
      <dc:creator>reedmohn</dc:creator>
      <dc:date>2015-03-20T11:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not seeing any fields extracted with my REGEX in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189167#M54511</link>
      <description>&lt;P&gt;Ah..  that's :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[log4net_format]
REGEX = ^.*\[(?&amp;lt;thread&amp;gt;\d+)\] (?&amp;lt;level&amp;gt;\w+)\s+(?&amp;lt;logger&amp;gt;.+)\s-\s+(?&amp;lt;messages&amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Mar 2015 11:43:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189167#M54511</guid>
      <dc:creator>reedmohn</dc:creator>
      <dc:date>2015-03-20T11:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not seeing any fields extracted with my REGEX in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189168#M54512</link>
      <description>&lt;P&gt;EDIT:  Got it working!&lt;/P&gt;

&lt;P&gt;I tried both..  got nothing at first.   But it seems we have winner &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;  Thanks!&lt;/P&gt;

&lt;P&gt;But your suggestion didn't work properly for most of the logs, since the third variable often contains whitespace. That's why I thought this didn't make a difference.&lt;BR /&gt;
Once I corrected that, this worked:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[log4net_format]
REGEX = ^.*\[(?&amp;lt;thread&amp;gt;\d+)\] (?&amp;lt;level&amp;gt;\w+)\s+(?&amp;lt;logger&amp;gt;.+)\s-\s+(?&amp;lt;messages&amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Out of interest:  Where is it you mean the greedy match won't work? There are a couple in the regexp.&lt;BR /&gt;
Having said that, I don't fully understand why this expression works better than the one I had originally.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2015 11:49:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-seeing-any-fields-extracted-with-my-REGEX-in/m-p/189168#M54512</guid>
      <dc:creator>reedmohn</dc:creator>
      <dc:date>2015-03-20T11:49:35Z</dc:date>
    </item>
  </channel>
</rss>

