<?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: Filtering unstructured multiline events with regular expression in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-unstructured-multiline-events-with-regular-expression/m-p/43765#M8175</link>
    <description>&lt;P&gt;This should help:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Indexmulti-lineevents"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Indexmulti-lineevents&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For multiline events your regex should maybe look something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(m?)^my regex here\b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See here:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/38753/regex-for-multiline-events"&gt;http://splunk-base.splunk.com/answers/38753/regex-for-multiline-events&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/20/what-does-m-mean-at-the-beginning-of-a-regex"&gt;http://splunk-base.splunk.com/answers/20/what-does-m-mean-at-the-beginning-of-a-regex&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Also, when you are writing a regex to send events to the nullQueue Splunk will save the entire event if the regex does &lt;EM&gt;not&lt;/EM&gt; match. &lt;/P&gt;</description>
    <pubDate>Fri, 24 Aug 2012 18:19:48 GMT</pubDate>
    <dc:creator>johandk</dc:creator>
    <dc:date>2012-08-24T18:19:48Z</dc:date>
    <item>
      <title>Filtering unstructured multiline events with regular expression</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-unstructured-multiline-events-with-regular-expression/m-p/43764#M8174</link>
      <description>&lt;P&gt;This is hopefully a simple question but I couldn't find the answer in transforms.conf. I am receiving an EXTREMELY high volume data source (network protocols dump). Every event averages 30-60 lines. There are a few conditions where I would like to keep this data (the entire record), everything else should go to the nullQueue.&lt;/P&gt;

&lt;P&gt;So, is there a way to specify to trash every event that doesn't match a particular regex/set of regex? The regexes could be found in different lines of the file depending on the network protocol.&lt;/P&gt;

&lt;P&gt;Also, if I used a regex which specifies line start/linebreak, will this only look at the very first line of the event?&lt;/P&gt;

&lt;P&gt;I have looked at &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.1/Deploy/Routeandfilterdatad#Keep_specific_events_and_discard_the_rest"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.1/Deploy/Routeandfilterdatad#Keep_specific_events_and_discard_the_rest&lt;/A&gt; but it doesn't seem to say how regular expressions work in multiline events. Will a regex save an entire event if the regex matches any part of any line in the event? Or does it only watch the first line?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2012 16:48:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-unstructured-multiline-events-with-regular-expression/m-p/43764#M8174</guid>
      <dc:creator>msarro</dc:creator>
      <dc:date>2012-08-24T16:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering unstructured multiline events with regular expression</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-unstructured-multiline-events-with-regular-expression/m-p/43765#M8175</link>
      <description>&lt;P&gt;This should help:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Indexmulti-lineevents"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Indexmulti-lineevents&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For multiline events your regex should maybe look something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(m?)^my regex here\b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See here:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/38753/regex-for-multiline-events"&gt;http://splunk-base.splunk.com/answers/38753/regex-for-multiline-events&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/20/what-does-m-mean-at-the-beginning-of-a-regex"&gt;http://splunk-base.splunk.com/answers/20/what-does-m-mean-at-the-beginning-of-a-regex&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Also, when you are writing a regex to send events to the nullQueue Splunk will save the entire event if the regex does &lt;EM&gt;not&lt;/EM&gt; match. &lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2012 18:19:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-unstructured-multiline-events-with-regular-expression/m-p/43765#M8175</guid>
      <dc:creator>johandk</dc:creator>
      <dc:date>2012-08-24T18:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering unstructured multiline events with regular expression</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-unstructured-multiline-events-with-regular-expression/m-p/43766#M8176</link>
      <description>&lt;P&gt;For multiline events, put  &lt;CODE&gt;(?m)&lt;/CODE&gt; at the beginning of your regular expression.This tells Splunk that it should look for matches across all the lines of the event.&lt;/P&gt;

&lt;P&gt;Use that along with with the directions in the manual - it looks like you've found them.&lt;/P&gt;

&lt;P&gt;Also, there are tons of references on regular expressions. Here is a personal favorite of mine:&lt;BR /&gt;&lt;BR /&gt;
&lt;A href="http://www.regular-expressions.info"&gt;http://www.regular-expressions.info&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2012 18:24:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-unstructured-multiline-events-with-regular-expression/m-p/43766#M8176</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-08-24T18:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering unstructured multiline events with regular expression</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-unstructured-multiline-events-with-regular-expression/m-p/43767#M8177</link>
      <description>&lt;P&gt;The code example should have &lt;CODE&gt;(?m)&lt;/CODE&gt; instead of &lt;CODE&gt;(m?)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2013 04:12:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-unstructured-multiline-events-with-regular-expression/m-p/43767#M8177</guid>
      <dc:creator>Jordan_Brough</dc:creator>
      <dc:date>2013-06-28T04:12:10Z</dc:date>
    </item>
  </channel>
</rss>

