<?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 problem with field extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68854#M17275</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to extract a field from a source, and when I test it, it appears to work, but in practice, it's grabbing too much.&lt;/P&gt;

&lt;P&gt;Two examples are below. I want to create a "trapType" field, and report on it. It should contain "Vendor Specific" or "Authentication Failure". When I test it, everything looks ok, but then when I run a search, it's including everything after the values. &lt;/P&gt;

&lt;P&gt;The field extract is: (?i) Type: (?P&lt;FIELDNAME&gt;.+)&lt;/FIELDNAME&gt;&lt;/P&gt;

&lt;P&gt;10:43:20.000 AM     &lt;/P&gt;

&lt;P&gt;10:43:20.000 AM     &lt;/P&gt;

&lt;P&gt;Trap: 25311425&lt;BR /&gt;
    Thu Feb  9 10:43:20 2012&lt;BR /&gt;
    Src IP: 6.7.8.9&lt;BR /&gt;
    Agent IP: 6.7.8.9&lt;BR /&gt;
    Trap Type: Authentication Failure&lt;BR /&gt;
    Specific Type: 0&lt;BR /&gt;
    Enterprise: 1.3.6.1.6.3.1.1.5&lt;BR /&gt;
    Object:1.3.6.1.4.1.9.2.1.5.0 Value:6.7.8.9&lt;/P&gt;

&lt;P&gt;Trap: 25311426&lt;BR /&gt;
    Thu Feb  9 10:43:20 2012&lt;BR /&gt;
    Src IP: 1.2.3.4&lt;BR /&gt;
    Agent IP: 1.2.3.4&lt;BR /&gt;
    Trap Type: Vendor Specific&lt;BR /&gt;
    Specific Type: 1&lt;BR /&gt;
    Enterprise: 1.3.6.1.4.1.9.9.41.2&lt;BR /&gt;
    Object:1.3.6.1.4.1.9.9.41.1.2.3.1.2.3175321 Value:PIM&lt;BR /&gt;
    Object:1.3.6.1.4.1.9.9.41.1.2.3.1.3.3175321 Value:5&lt;BR /&gt;
    Object:1.3.6.1.4.1.9.9.41.1.2.3.1.4.3175321 Value:INVALID_SRC_REG&lt;BR /&gt;
    Object:1.3.6.1.4.1.9.9.41.1.2.3.1.5.3175321 Value:Received Register from 1.2.3.4 for (1.2.3.4, 1.2.3.4), not willing to be RP&lt;BR /&gt;
    Object:1.3.6.1.4.1.9.9.41.1.2.3.1.6.3175321 Value:264d 04:40:27&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 11:22:16 GMT</pubDate>
    <dc:creator>a212830</dc:creator>
    <dc:date>2020-09-28T11:22:16Z</dc:date>
    <item>
      <title>problem with field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68854#M17275</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to extract a field from a source, and when I test it, it appears to work, but in practice, it's grabbing too much.&lt;/P&gt;

&lt;P&gt;Two examples are below. I want to create a "trapType" field, and report on it. It should contain "Vendor Specific" or "Authentication Failure". When I test it, everything looks ok, but then when I run a search, it's including everything after the values. &lt;/P&gt;

&lt;P&gt;The field extract is: (?i) Type: (?P&lt;FIELDNAME&gt;.+)&lt;/FIELDNAME&gt;&lt;/P&gt;

&lt;P&gt;10:43:20.000 AM     &lt;/P&gt;

&lt;P&gt;10:43:20.000 AM     &lt;/P&gt;

&lt;P&gt;Trap: 25311425&lt;BR /&gt;
    Thu Feb  9 10:43:20 2012&lt;BR /&gt;
    Src IP: 6.7.8.9&lt;BR /&gt;
    Agent IP: 6.7.8.9&lt;BR /&gt;
    Trap Type: Authentication Failure&lt;BR /&gt;
    Specific Type: 0&lt;BR /&gt;
    Enterprise: 1.3.6.1.6.3.1.1.5&lt;BR /&gt;
    Object:1.3.6.1.4.1.9.2.1.5.0 Value:6.7.8.9&lt;/P&gt;

&lt;P&gt;Trap: 25311426&lt;BR /&gt;
    Thu Feb  9 10:43:20 2012&lt;BR /&gt;
    Src IP: 1.2.3.4&lt;BR /&gt;
    Agent IP: 1.2.3.4&lt;BR /&gt;
    Trap Type: Vendor Specific&lt;BR /&gt;
    Specific Type: 1&lt;BR /&gt;
    Enterprise: 1.3.6.1.4.1.9.9.41.2&lt;BR /&gt;
    Object:1.3.6.1.4.1.9.9.41.1.2.3.1.2.3175321 Value:PIM&lt;BR /&gt;
    Object:1.3.6.1.4.1.9.9.41.1.2.3.1.3.3175321 Value:5&lt;BR /&gt;
    Object:1.3.6.1.4.1.9.9.41.1.2.3.1.4.3175321 Value:INVALID_SRC_REG&lt;BR /&gt;
    Object:1.3.6.1.4.1.9.9.41.1.2.3.1.5.3175321 Value:Received Register from 1.2.3.4 for (1.2.3.4, 1.2.3.4), not willing to be RP&lt;BR /&gt;
    Object:1.3.6.1.4.1.9.9.41.1.2.3.1.6.3175321 Value:264d 04:40:27&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:22:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68854#M17275</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2020-09-28T11:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: problem with field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68855#M17276</link>
      <description>&lt;P&gt;Can you either put up a pastebin of the input source or include in a code section so we can see the true raw input values?  That would help me load it into a test instance to help diagnose the issue with your regex.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2012 16:47:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68855#M17276</guid>
      <dc:creator>clintsharp</dc:creator>
      <dc:date>2012-02-09T16:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: problem with field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68856#M17277</link>
      <description>&lt;P&gt;Could you be a little more clear in what you are seeing, what do you mean you are including everything after the values?  if the event you are inspecting is a true multiline event then you should have no issue with using that field extraction inside your props.conf ... you could also be a little more specific like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EXTRACT-fieldname = (?im).*Trap\sType:\s(?&amp;lt;fieldname&amp;gt;.+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your regex should match everything until the end of the line, so if anything else is being picked up thats why I ask if it's a true multiline event you're inspecting.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2012 17:28:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68856#M17277</guid>
      <dc:creator>joshd</dc:creator>
      <dc:date>2012-02-09T17:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: problem with field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68857#M17278</link>
      <description>&lt;P&gt;Yes, it's a multiline event. I've attached a screenshot of what happens. &lt;IMG src="http://splunk-base.splunk.com/trapxExtract.jpg" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2012 18:28:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68857#M17278</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2012-02-09T18:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: problem with field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68858#M17279</link>
      <description>&lt;P&gt;Unfortunately I cannot see the screenshot... check my updated example before, realized I forgot to add (?m) at the start to specify multiline events &lt;EM&gt;palmface&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2012 20:29:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68858#M17279</guid>
      <dc:creator>joshd</dc:creator>
      <dc:date>2012-02-09T20:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: problem with field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68859#M17280</link>
      <description>&lt;P&gt;I tried the latest change and I'm still getting the same thing (bounced the app). I keep trying to upload the image, but it doesn't get added. Here's the text from the "pull-out" window for the trapType field. It's taking the information after the Trap Type: value, but it should stop at the end of that line, and it's not.  &lt;/P&gt;

&lt;P&gt;Authenticatio....6.1.4.1.3224   4,629   9.719%&lt;BR /&gt;&lt;BR /&gt;
Authenticatio....4.1.2021.251   1,440   3.023%&lt;BR /&gt;&lt;BR /&gt;
Authenticatio...e:10.47.89.25   1,060   2.226%&lt;BR /&gt;&lt;BR /&gt;
Authentication...e:10.93.65.11  788 1.654%&lt;BR /&gt;&lt;BR /&gt;
Authentication...4.1.564.101.1  500 1.05%&lt;BR /&gt;&lt;BR /&gt;
Authentication...10.165.27.145  480 1.008%&lt;BR /&gt;&lt;BR /&gt;
Authentication...e:10.47.89.25  444 0.932%&lt;BR /&gt;&lt;BR /&gt;
Authenticatio...1.8072.3.2.255  392 0.823%&lt;BR /&gt;&lt;BR /&gt;
Vendor Specif...1.4.1.3375.2.4  382 0.802%&lt;BR /&gt;&lt;BR /&gt;
Vendor Specif...1.4.1.3375.2.4&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2012 22:22:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68859#M17280</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2012-02-09T22:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: problem with field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68860#M17281</link>
      <description>&lt;P&gt;I'll ask again, can you post a pastebin of the original log data?  Something with the line breaks and everything preserved?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2012 22:23:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68860#M17281</guid>
      <dc:creator>clintsharp</dc:creator>
      <dc:date>2012-02-09T22:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: problem with field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68861#M17282</link>
      <description>&lt;P&gt;Not sure what a pastebin is, but I did a copy/paste of some of the log data.&lt;/P&gt;

&lt;P&gt;Trap: 24910058&lt;BR /&gt;
        Thu Feb  9 02:01:11 2012&lt;BR /&gt;
        Src IP: 12.3.4.5&lt;BR /&gt;
        Agent IP: 1.2.3.4&lt;BR /&gt;
        Trap Type: Vendor Specific&lt;BR /&gt;
        Specific Type: 1&lt;BR /&gt;
        Enterprise: 1.3.6.1.4.1.9.9.43.2&lt;BR /&gt;
        Object:1.3.6.1.4.1.9.9.43.1.1.6.1.3.3997 Value:1&lt;BR /&gt;
        Object:1.3.6.1.4.1.9.9.43.1.1.6.1.4.3997 Value:4&lt;BR /&gt;
        Object:1.3.6.1.4.1.9.9.43.1.1.6.1.5.3997 Value:6&lt;/P&gt;

&lt;P&gt;Trap: 24910059&lt;BR /&gt;
        Thu Feb  9 02:01:11 2012&lt;BR /&gt;
        Src IP: 1.2.3.4&lt;BR /&gt;
        Agent IP: 1.2.3.4&lt;BR /&gt;
        Trap Type: Vendor Specific&lt;BR /&gt;
        Specific Type: 1&lt;BR /&gt;
        Enterprise: 1.3.6.1.4.1.9.9.41.2&lt;BR /&gt;
        Object:1.3.6.1.4.1.9.9.41.1.2.3.1.2.0 Value:PAGP&lt;BR /&gt;
        Object:1.3.6.1.4.1.9.9.41.1.2.3.1.3.0 Value:6&lt;BR /&gt;
        Object:1.3.6.1.4.1.9.9.41.1.2.3.1.4.0 Value:PAGP&lt;BR /&gt;
        Object:1.3.6.1.4.1.9.9.41.1.2.3.1.5.0 Value:2012 Feb 09 02:01:11 eastern -05:00 %PAGP-5-PORTTOSTP:Port 2/17 joined bridge port 2/17&lt;BR /&gt;
        Object:1.3.6.1.4.1.9.9.41.1.2.3.1.6.0 Value:279122402&lt;/P&gt;

&lt;P&gt;Trap: 24910060&lt;BR /&gt;
        Thu Feb  9 02:01:12 2012&lt;BR /&gt;
        Src IP: 1.2.3.4&lt;BR /&gt;
        Agent IP: 1.2.3.4&lt;BR /&gt;
        Trap Type: Vendor Specific&lt;BR /&gt;
        Specific Type: 1&lt;BR /&gt;
        Enterprise: 1.3.6.1.4.1.9.9.41.2&lt;BR /&gt;
        Object:1.3.6.1.4.1.9.9.41.1.2.3.1.2.61328708 Value:PIM&lt;BR /&gt;
        Object:1.3.6.1.4.1.9.9.41.1.2.3.1.3.61328708 Value:5&lt;BR /&gt;
        Object:1.3.6.1.4.1.9.9.41.1.2.3.1.4.61328708 Value:INVALID_SRC_REG&lt;BR /&gt;
        Object:1.3.6.1.4.1.9.9.41.1.2.3.1.5.61328708 Value:Received Register from 1.2.3.4 for (1.2.3.4, 2.3.4.5), not willing to be RP&lt;BR /&gt;
        Object:1.3.6.1.4.1.9.9.41.1.2.3.1.6.61328708 Value:468d 06:45:54&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:22:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68861#M17282</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2020-09-28T11:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: problem with field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68862#M17283</link>
      <description>&lt;P&gt;Thanks, I now have the data, but I'm curious, can you provide what your inputs.conf and props.conf entries for this file and sourcetype look like?  Without some changes, Splunk splits this data into multiple events etc, so I'm curious if you've already done some work to teach splunk how to interpret these events like setting LINE_BREAKER, or specifying regexes to teach splunk to break events.  &lt;/P&gt;

&lt;P&gt;BTW, your rex extraction works fine for me, so I'm still trying to dig in and reproduce your issue.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 17:44:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/problem-with-field-extraction/m-p/68862#M17283</guid>
      <dc:creator>clintsharp</dc:creator>
      <dc:date>2012-02-10T17:44:31Z</dc:date>
    </item>
  </channel>
</rss>

