<?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 handle LINE_BREAKER regex for multiple capture groups?  Specifically now that we are getting both ip4 and ip6 logs? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-LINE-BREAKER-regex-for-multiple-capture-groups/m-p/291997#M55650</link>
    <description>&lt;P&gt;Reading the LINE_BREAKER documentation I'm wondering if it's something to do with the parentheses around the regex match &lt;EM&gt;after&lt;/EM&gt; the ([\r\n]+)&lt;/P&gt;

&lt;P&gt;As per the props.conf documentation it says:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Example 1:  LINE_BREAKER = end(\n)begin|end2(\n)begin2|begin3

  * A line ending with 'end' followed a line beginning with 'begin' would
    match the first branch, and the first capturing group would have a match
    according to rule 1.  That particular newline would become a break
    between lines.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So I'm assuming you probably don't want to have the various (), also you could probably simplify it to match part of the IP address, unless you often have lines that look similar, normally I would match the first few parts of the IP address or similar...&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;([\r\n]+)\d+\.\d+\.\d+\.\d+|([\r\n]+)[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Perhaps?&lt;BR /&gt;
If this works I'll convert it to an answer...&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2017 01:42:28 GMT</pubDate>
    <dc:creator>gjanders</dc:creator>
    <dc:date>2017-10-10T01:42:28Z</dc:date>
    <item>
      <title>How to handle LINE_BREAKER regex for multiple capture groups?  Specifically now that we are getting both ip4 and ip6 logs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-LINE-BREAKER-regex-for-multiple-capture-groups/m-p/291996#M55649</link>
      <description>&lt;P&gt;In the past we had an easy LINE_BREAKER regex that broke on newlines where an ip4 was present ([\r\n]+)\d+.\d+.\d+.\d+&lt;/P&gt;

&lt;P&gt;Now we have some logs with ip6 in addition to ip4 being logged, so I was hoping I can just do this via piping it out to alternate capture groups depending on which ip it matches:&lt;/P&gt;

&lt;P&gt;([\r\n]+)(\d+.\d+.\d+.\d+|(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])))&lt;/P&gt;

&lt;P&gt;Is there something present where splunk only expects one capture group to be here for the LINE_BREAKER regex?  I'm wondering how we can handle linebreakers now that we have 2 different style of IP that can come in.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 23:05:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-LINE-BREAKER-regex-for-multiple-capture-groups/m-p/291996#M55649</guid>
      <dc:creator>briancronrath</dc:creator>
      <dc:date>2017-10-09T23:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle LINE_BREAKER regex for multiple capture groups?  Specifically now that we are getting both ip4 and ip6 logs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-LINE-BREAKER-regex-for-multiple-capture-groups/m-p/291997#M55650</link>
      <description>&lt;P&gt;Reading the LINE_BREAKER documentation I'm wondering if it's something to do with the parentheses around the regex match &lt;EM&gt;after&lt;/EM&gt; the ([\r\n]+)&lt;/P&gt;

&lt;P&gt;As per the props.conf documentation it says:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Example 1:  LINE_BREAKER = end(\n)begin|end2(\n)begin2|begin3

  * A line ending with 'end' followed a line beginning with 'begin' would
    match the first branch, and the first capturing group would have a match
    according to rule 1.  That particular newline would become a break
    between lines.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So I'm assuming you probably don't want to have the various (), also you could probably simplify it to match part of the IP address, unless you often have lines that look similar, normally I would match the first few parts of the IP address or similar...&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;([\r\n]+)\d+\.\d+\.\d+\.\d+|([\r\n]+)[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Perhaps?&lt;BR /&gt;
If this works I'll convert it to an answer...&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 01:42:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-LINE-BREAKER-regex-for-multiple-capture-groups/m-p/291997#M55650</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2017-10-10T01:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle LINE_BREAKER regex for multiple capture groups?  Specifically now that we are getting both ip4 and ip6 logs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-LINE-BREAKER-regex-for-multiple-capture-groups/m-p/291998#M55651</link>
      <description>&lt;P&gt;Thanks gareth, feel free to convert to answer and I will mark it as solved!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 23:38:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-LINE-BREAKER-regex-for-multiple-capture-groups/m-p/291998#M55651</guid>
      <dc:creator>briancronrath</dc:creator>
      <dc:date>2017-10-12T23:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle LINE_BREAKER regex for multiple capture groups?  Specifically now that we are getting both ip4 and ip6 logs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-LINE-BREAKER-regex-for-multiple-capture-groups/m-p/291999#M55652</link>
      <description>&lt;P&gt;Done, thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 00:56:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-handle-LINE-BREAKER-regex-for-multiple-capture-groups/m-p/291999#M55652</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2017-10-13T00:56:29Z</dc:date>
    </item>
  </channel>
</rss>

