<?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: multiline event breaking issue in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19124#M2663</link>
    <description>&lt;P&gt;Just happened to come across this param as well, and tested it. I set it to 600 seconds, more than enough in my case, however I still got the first event as a partial event. My event/line breaking configs in props.conf should be fine because if the log file already has the complete event lines, before splunk indexes it, then there are no problems.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Apr 2012 22:30:19 GMT</pubDate>
    <dc:creator>blee_i365</dc:creator>
    <dc:date>2012-04-04T22:30:19Z</dc:date>
    <item>
      <title>multiline event breaking issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19122#M2661</link>
      <description>&lt;P&gt;My log file is like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;StartEvent 01&lt;BR /&gt;
some data 001&lt;BR /&gt;
some data 002&lt;BR /&gt;
some data 003&lt;BR /&gt;
some data 004&lt;BR /&gt;
EndEvent 01&lt;BR /&gt;
StartEvent 02&lt;BR /&gt;
some other data 001&lt;BR /&gt;
some other data 002&lt;BR /&gt;
some other data 003&lt;BR /&gt;
some other data 004&lt;BR /&gt;
EndEvent 02&lt;BR /&gt;
...&lt;BR /&gt;
...&lt;BR /&gt;
...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;In my props.conf, I have these values:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;SHOULD_LINEMERGE = true&lt;BR /&gt;
BREAK_ONLY_BEFORE = StartEvent \d\d&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If my log file contains all the lines from "StartEvent 01" to "EndEvent 01" PRIOR TO Splunk seeing the file for the first time, then the lines are successfully indexed as multiline events as follows:&lt;/P&gt;

&lt;P&gt;First event:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;StartEvent 01&lt;BR /&gt;
some data 001&lt;BR /&gt;
some data 002&lt;BR /&gt;
some data 003&lt;BR /&gt;
some data 004&lt;BR /&gt;
EndEvent 01&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Second event:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;StartEvent 02&lt;BR /&gt;
some other data 001&lt;BR /&gt;
some other data 002&lt;BR /&gt;
some other data 003&lt;BR /&gt;
some other data 004&lt;BR /&gt;
EndEvent 02&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;However If my application is still in the process of writing to the log file, and Splunk indexes the file, then event-breaking is totally messed up. For example, my app would flush the following lines to the log at first:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;StartEvent 01&lt;BR /&gt;
some data 001&lt;BR /&gt;
some data 002&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and then couple minutes later these additional lines are appended:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;some data 003&lt;BR /&gt;
some data 003&lt;BR /&gt;
EndEvent 01&lt;BR /&gt;
StartEvent 02&lt;BR /&gt;
some other data 001&lt;BR /&gt;
some other data 002&lt;BR /&gt;
some other data 003&lt;BR /&gt;
some other data 004&lt;BR /&gt;
EndEvent 02&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;In this case I would get these events instead:&lt;/P&gt;

&lt;P&gt;First event:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;StartEvent 01&lt;BR /&gt;
some data 001&lt;BR /&gt;
some data 002&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Second event:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;some data 003&lt;BR /&gt;
some data 004&lt;BR /&gt;
EndEvent 01&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Third event:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;StartEvent 02&lt;BR /&gt;
some other data 001&lt;BR /&gt;
some other data 002&lt;BR /&gt;
some other data 003&lt;BR /&gt;
some other data 004&lt;BR /&gt;
EndEvent 02&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The first and second events in this case should really have been combined as a single event, but during index time Splunk "closed" the first event prematurely because my app had stopped writing to the log temporarily.&lt;/P&gt;

&lt;P&gt;I want to see only two multiline events regardless of when or what my app writes to the log file. Is this possible via configuration changes in Splunk?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2012 20:46:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19122#M2661</guid>
      <dc:creator>blee_i365</dc:creator>
      <dc:date>2012-04-04T20:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: multiline event breaking issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19123#M2662</link>
      <description>&lt;P&gt;Inputs.conf has a setting which might be useful for the scenario of an application not writing to a log file for a period of time. &lt;/P&gt;

&lt;P&gt;Inputs.conf.spec:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;time_before_close = &amp;lt;integer&amp;gt;
* Modtime delta required before Splunk can close a file on EOF.
* Tells the system not to close files that have been updated in past &amp;lt;integer&amp;gt; seconds.
* Defaults to 3.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I ran into a similar situation with someone else recently where they thought line breaking wasn't the issue, but we found that under another config, things worked better. I'll give you what I did with that person in a manner I think is altered for your environment.&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LINE_BREAKER = ([\r\n]+)StartEvent \d{2}
TRUNCATE = 0
MAX_EVENTS = 2560
SHOULD_LINEMERGE = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is, of course, assuming that the line breaking is properly configured. &lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2012 21:53:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19123#M2662</guid>
      <dc:creator>jbsplunk</dc:creator>
      <dc:date>2012-04-04T21:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: multiline event breaking issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19124#M2663</link>
      <description>&lt;P&gt;Just happened to come across this param as well, and tested it. I set it to 600 seconds, more than enough in my case, however I still got the first event as a partial event. My event/line breaking configs in props.conf should be fine because if the log file already has the complete event lines, before splunk indexes it, then there are no problems.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2012 22:30:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19124#M2663</guid>
      <dc:creator>blee_i365</dc:creator>
      <dc:date>2012-04-04T22:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: multiline event breaking issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19125#M2664</link>
      <description>&lt;P&gt;It almost worked. Almost. Lines from the initial flush would always be indexed as one event regardless of the time_before_close config and line/event breaking configs. However if there are subsequent lines being flushed and appended to the same log, Splunk would then wait [time_before_close] seconds after each flush/write, before indexing any lines since the initial flush.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:37:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19125#M2664</guid>
      <dc:creator>blee_i365</dc:creator>
      <dc:date>2020-09-28T11:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: multiline event breaking issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19126#M2665</link>
      <description>&lt;P&gt;Maybe something at the first event is different? You could try something like this to start at the beginning of the line:&lt;/P&gt;

&lt;P&gt;BREAK_ONLY_BEFORE = ^StartEvent \d\d&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:37:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19126#M2665</guid>
      <dc:creator>jbsplunk</dc:creator>
      <dc:date>2020-09-28T11:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: multiline event breaking issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19127#M2666</link>
      <description>&lt;P&gt;Hey jbsplunk, I have tried various ways to configure breaking. In all cases, if all the lines were already present before splunk sees the file, then all things are working nicely. This should indicate I have valid line/event breaking configs. Only new log that are still being written to in trunks have this problem.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2012 23:23:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19127#M2666</guid>
      <dc:creator>blee_i365</dc:creator>
      <dc:date>2012-04-04T23:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: multiline event breaking issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19128#M2667</link>
      <description>&lt;P&gt;jbsplunk: I quote this.&lt;/P&gt;

&lt;P&gt;Maybe something at the first event is different? You could try something like this to start at the beginning of the line:&lt;/P&gt;

&lt;P&gt;BREAK_ONLY_BEFORE = ^StartEvent \d\d&lt;/P&gt;

&lt;P&gt;Missing slashes added for TS. The regex will fail if the syntactics is not called well.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2012 03:22:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19128#M2667</guid>
      <dc:creator>e82than</dc:creator>
      <dc:date>2012-04-05T03:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: multiline event breaking issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19129#M2668</link>
      <description>&lt;P&gt;Thanks e82than. I did notice the missing slashes. They unfortunately didn't help in my case.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2012 16:09:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19129#M2668</guid>
      <dc:creator>blee_i365</dc:creator>
      <dc:date>2012-04-05T16:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: multiline event breaking issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19130#M2669</link>
      <description>&lt;P&gt;At this point, if you're an enterprise customer, I would suggest that you open a case with support, providing them a sample of the data. I still feel as though the problem is likely with line breaking, and would try to use LINE_BREAKER with SHOULD_LINEMERGE set to false. I edited the answer to what I would try.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:37:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19130#M2669</guid>
      <dc:creator>jbsplunk</dc:creator>
      <dc:date>2020-09-28T11:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: multiline event breaking issue</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19131#M2670</link>
      <description>&lt;P&gt;I have exactly the same issue (using log4j with buffered io and immediate flush of false) Splunk (universal forwarder) is picking up some of the events before they have been fully logged (they can be truncated mid line before enough data accumulates and flushes the remainder of the event from the buffer to the file system). When the remaining log data is written and sent to the indexer, it is indexed as a separate event. (regardless of any SHOULD_LINEMERGE settings etc.)  &lt;/P&gt;

&lt;P&gt;My guess is that there is some sort of timeout for multi line events to complete?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2012 16:53:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/multiline-event-breaking-issue/m-p/19131#M2670</guid>
      <dc:creator>henchrm</dc:creator>
      <dc:date>2012-11-12T16:53:11Z</dc:date>
    </item>
  </channel>
</rss>

