<?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 is capturing too much in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Field-Extraction-is-capturing-too-much/m-p/416133#M7257</link>
    <description>&lt;P&gt;What nick says: fix your linebreaking, as it seems to be showing multiple events glued together.&lt;/P&gt;

&lt;P&gt;But I would also try to avoid using &lt;CODE&gt;.*&lt;/CODE&gt;. Assuming error codes cannot contain () characters, the following should also work and is much safer and also performs much better: &lt;BR /&gt;
&lt;CODE&gt;^ErrorMsg\:\s(?&amp;lt;Error_Code&amp;gt;[^\(]*)\s\((?&amp;lt;Error_Timestamp&amp;gt;\d+\/\d+\/\d+\s\d+\:\d+\s\w+)\)&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Mar 2019 16:52:23 GMT</pubDate>
    <dc:creator>FrankVl</dc:creator>
    <dc:date>2019-03-06T16:52:23Z</dc:date>
    <item>
      <title>Field Extraction is capturing too much</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Field-Extraction-is-capturing-too-much/m-p/416131#M7255</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I'm not great with regex and I've been looking at lots of examples of how to only grab the first instance of a match but I can't make it work. Here is what I've got so far:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^ErrorMsg\:\s(?&amp;lt;Error_Code&amp;gt;.*)\s\((?&amp;lt;Error_Timestamp&amp;gt;\d+\/\d+\/\d+\s\d+\:\d+\s\w+)\)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This returns the following:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="Example Results"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6634iF05A55898EBEFDDA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example Results" alt="Example Results" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;You can see that the bottom two lines are going all the way out because they find a second match because of the way the event is being broken out for this source.&lt;/P&gt;

&lt;P&gt;How can I get it to ONLY match the first instance of the error code and timestamp?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 16:09:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Field-Extraction-is-capturing-too-much/m-p/416131#M7255</guid>
      <dc:creator>jeck11</dc:creator>
      <dc:date>2019-03-06T16:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction is capturing too much</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Field-Extraction-is-capturing-too-much/m-p/416132#M7256</link>
      <description>&lt;P&gt;The root cause of this looks like your event breaking is failing.&lt;/P&gt;

&lt;P&gt;Have you configured any breaking or Timestamp extraction in props.conf for this sourcetype?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 16:36:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Field-Extraction-is-capturing-too-much/m-p/416132#M7256</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2019-03-06T16:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction is capturing too much</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Field-Extraction-is-capturing-too-much/m-p/416133#M7257</link>
      <description>&lt;P&gt;What nick says: fix your linebreaking, as it seems to be showing multiple events glued together.&lt;/P&gt;

&lt;P&gt;But I would also try to avoid using &lt;CODE&gt;.*&lt;/CODE&gt;. Assuming error codes cannot contain () characters, the following should also work and is much safer and also performs much better: &lt;BR /&gt;
&lt;CODE&gt;^ErrorMsg\:\s(?&amp;lt;Error_Code&amp;gt;[^\(]*)\s\((?&amp;lt;Error_Timestamp&amp;gt;\d+\/\d+\/\d+\s\d+\:\d+\s\w+)\)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 16:52:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Field-Extraction-is-capturing-too-much/m-p/416133#M7257</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-03-06T16:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction is capturing too much</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Field-Extraction-is-capturing-too-much/m-p/416134#M7258</link>
      <description>&lt;P&gt;If you want to trap only the first "AwE-4444 Agent/client/database/network" this could help&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\w+-\d+\s\w+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if this helps&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 16:56:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Field-Extraction-is-capturing-too-much/m-p/416134#M7258</guid>
      <dc:creator>jnahuelperez35</dc:creator>
      <dc:date>2019-03-06T16:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction is capturing too much</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Field-Extraction-is-capturing-too-much/m-p/416135#M7259</link>
      <description>&lt;P&gt;I agree with both you and Nick that the root of the issue is the sourcetype configuration but that one is beyond me. I'm hoping that our admin will be able to come up with something better. &lt;/P&gt;

&lt;P&gt;Your suggestion worked perfectly though! TY&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 17:16:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Field-Extraction-is-capturing-too-much/m-p/416135#M7259</guid>
      <dc:creator>jeck11</dc:creator>
      <dc:date>2019-03-06T17:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction is capturing too much</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Field-Extraction-is-capturing-too-much/m-p/416136#M7260</link>
      <description>&lt;P&gt;Thank you for helping make it less greedy. Unfortunately, I don't know how many times I'd have to repeat the \s\w combo. I'm not sure how many words can be in the error code's name. &lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 17:23:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Field-Extraction-is-capturing-too-much/m-p/416136#M7260</guid>
      <dc:creator>jeck11</dc:creator>
      <dc:date>2019-03-06T17:23:25Z</dc:date>
    </item>
  </channel>
</rss>

