<?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 Ignore data after CRLF in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390212#M94545</link>
    <description>&lt;P&gt;When running a search the _raw field returns results that typically end with the ] character. On a rare occasion the search has a CRLF and additional lines of data. I am trying to figure a way to ignore anything beyond the last ] or after a CRLF.&lt;/P&gt;

&lt;P&gt;Example 1: &lt;BR /&gt;
Jun 14 13:00:00 -07:00 HOSTNAME &lt;A href="https://community.splunk.com/Normal%20result"&gt;condition is inside brackets&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Example 2: &lt;BR /&gt;
Jun 14 13:00:00 -07:00 HOSTNAME [condition is inside brackets]&lt;BR /&gt;
Jun 14 13:00:00 -07:00 HOSTNAME [unexpected results here]&lt;/P&gt;

&lt;P&gt;My goal in example 2 is to only return the results of the first line.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jun 2018 17:58:55 GMT</pubDate>
    <dc:creator>donemery</dc:creator>
    <dc:date>2018-06-20T17:58:55Z</dc:date>
    <item>
      <title>Ignore data after CRLF</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390212#M94545</link>
      <description>&lt;P&gt;When running a search the _raw field returns results that typically end with the ] character. On a rare occasion the search has a CRLF and additional lines of data. I am trying to figure a way to ignore anything beyond the last ] or after a CRLF.&lt;/P&gt;

&lt;P&gt;Example 1: &lt;BR /&gt;
Jun 14 13:00:00 -07:00 HOSTNAME &lt;A href="https://community.splunk.com/Normal%20result"&gt;condition is inside brackets&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Example 2: &lt;BR /&gt;
Jun 14 13:00:00 -07:00 HOSTNAME [condition is inside brackets]&lt;BR /&gt;
Jun 14 13:00:00 -07:00 HOSTNAME [unexpected results here]&lt;/P&gt;

&lt;P&gt;My goal in example 2 is to only return the results of the first line.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 17:58:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390212#M94545</guid>
      <dc:creator>donemery</dc:creator>
      <dc:date>2018-06-20T17:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore data after CRLF</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390213#M94546</link>
      <description>&lt;P&gt;I've posted this as a little regex challenge in the #regex channel of the splunk slack channel.  you should get a way to do this shortly.&lt;/P&gt;

&lt;P&gt;the general form of this is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex mode=sed field=_raw "s/thing you want to change/thing you want to change it to/g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...so in between the first two &lt;CODE&gt;/&lt;/CODE&gt;, you need to match CRLF and then everything to the end of the event, and then put nothing between the second and third &lt;CODE&gt;/&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 00:14:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390213#M94546</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-06-21T00:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore data after CRLF</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390214#M94547</link>
      <description>&lt;P&gt;Give this a try:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "\](?:\s*\((?&amp;lt;results_normal&amp;gt;[^\)]*)|[^\[]+\[(?&amp;lt;result_unusual&amp;gt;[^\]]*))" | table results_normal result_unusual _raw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jun 2018 00:19:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390214#M94547</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2018-06-21T00:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore data after CRLF</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390215#M94548</link>
      <description>&lt;P&gt;Actually this might be closer to what you need if you just want to delete everything after the first line:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex mode=sed field=_raw "s/\r?\n[\s\S]*//"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jun 2018 00:27:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390215#M94548</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2018-06-21T00:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore data after CRLF</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390216#M94549</link>
      <description>&lt;P&gt;Just in case that one doesn't work, give this a try too:&lt;BR /&gt;
    | rex mode=sed field=_raw "s/][\s\S]*/]/"&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 00:33:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390216#M94549</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2018-06-21T00:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore data after CRLF</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390217#M94550</link>
      <description>&lt;P&gt;Both options worked for me. Thanks so much for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 14:40:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390217#M94550</guid>
      <dc:creator>donemery</dc:creator>
      <dc:date>2018-06-21T14:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore data after CRLF</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390218#M94551</link>
      <description>&lt;P&gt;You are not going to like this answer but the problem is not in your searching, it is in your forwarding.  These events are not properly line-broken.  Somebody has either redefined &lt;CODE&gt;LINE_BREAKER&lt;/CODE&gt; or turned on &lt;CODE&gt;SHOULD_LINEMERGE = true&lt;/CODE&gt;.  You need to find the &lt;CODE&gt;props.conf&lt;/CODE&gt; settings on the Indexers or HF for this sourcetype and fix the line-breaking.  Then you will not have this problem AND the data will be correct for everybody, without mis-joined events.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jun 2018 23:42:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390218#M94551</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-06-30T23:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore data after CRLF</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390219#M94552</link>
      <description>&lt;P&gt;Thanks for your help! We were working on fixing the configuration issue as well and fortunately it is resolved now.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jul 2018 15:07:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Ignore-data-after-CRLF/m-p/390219#M94552</guid>
      <dc:creator>donemery</dc:creator>
      <dc:date>2018-07-20T15:07:55Z</dc:date>
    </item>
  </channel>
</rss>

