<?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: Events Delayed / Not Split Correctly in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Events-Delayed-Not-Split-Correctly/m-p/161101#M32658</link>
    <description>&lt;P&gt;Thanks a lot - that's exactly what I was looking for.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Dec 2017 06:36:05 GMT</pubDate>
    <dc:creator>krdo</dc:creator>
    <dc:date>2017-12-06T06:36:05Z</dc:date>
    <item>
      <title>Events Delayed / Not Split Correctly</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Events-Delayed-Not-Split-Correctly/m-p/161099#M32656</link>
      <description>&lt;H4&gt;Questions&lt;/H4&gt;

&lt;OL&gt;
&lt;LI&gt;Can anyone point me to a (really) detailed description of how the Forwarder/Indexer work?&lt;/LI&gt;
&lt;LI&gt;When does Splunk actually split files into events?&lt;/LI&gt;
&lt;LI&gt;Why are my events delayed when using &lt;CODE&gt;MUST_BREAK_AFTER&lt;/CODE&gt; and &lt;CODE&gt;time_before_close&lt;/CODE&gt;?&lt;/LI&gt;
&lt;LI&gt;Is it possible to tell Splunk to ignore EOF completely or until the file is not written to for a specified amount of time?&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;We are using Splunk 6.2 by the way.&lt;/P&gt;

&lt;H4&gt;Description&lt;/H4&gt;

&lt;P&gt;We are writing application (.NET Framework) logs to a file on a Windows system. Occasionally some events are split at seemingly random locations. When importing the log file containing a split event on another Splunk instance, the event is not split. Neither the log file size, the location of the events in the log file nor the size of the events are consistent. Further investigation lead me to this question: &lt;A href="http://answers.splunk.com/answers/188776/events-are-not-properly-split.html" target="_blank"&gt;1&lt;/A&gt;. The problem explained there seems to be similar, tough in our case events are not split periodically and we do not use/set the &lt;CODE&gt;time_before_close&lt;/CODE&gt; parameter. Basically, due to buffering etc. it is possible that only a part of a event is written to the file before remaining data is added, maybe causing the problem.&lt;/P&gt;

&lt;P&gt;So I created a simple test setup to check the behavior of Splunk when writing partial events to a file:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;inputs.conf&lt;/STRONG&gt;&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
[monitor://C:\Logs]&lt;BR /&gt;
disabled = false&lt;BR /&gt;
host = MyHost&lt;BR /&gt;
index = test&lt;BR /&gt;
whitelist = ^.&lt;EM&gt;.log$&lt;BR /&gt;
sourcetype = mySourcetype&lt;BR /&gt;
&lt;/EM&gt;&lt;/PRE&gt;&lt;EM&gt;props.conf&lt;/EM&gt;*&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
[mySourcetype]&lt;BR /&gt;
CHARSET = CP1252&lt;BR /&gt;
BREAK_ONLY_BEFORE_DATE  = false&lt;BR /&gt;
BREAK_ONLY_BEFORE       = [Start]&lt;BR /&gt;
MAX_EVENTS              = 1000000000&lt;BR /&gt;
TIME_PREFIX             = ([\r\n]|\s)timestamp="&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 64&lt;BR /&gt;
&lt;/PRE&gt;Then I created the file with the following content (a partial event):&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;C:/Logs/MyLog.log&lt;/STRONG&gt;&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
[Start]&lt;BR /&gt;
Test&lt;BR /&gt;
&lt;/PRE&gt;while running a real-time search. After a few seconds a new event was reported. So I assume because the file has not been written to for 3 seconds ( &lt;CODE&gt;time_before_close&lt;/CODE&gt; defaults to 3), Splunk determines this must be a complete event (even tough the documentation for &lt;CODE&gt;BREAK_ONLY_BEFORE&lt;/CODE&gt; states that &lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Splunk creates a new event only if it encounters a new line that matches the regular expression &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/Admin/Propsconf" target="_blank"&gt;2&lt;/A&gt;.&lt;/BLOCKQUOTE&gt;There is no new line matching the regular expression at the end of the file, not even a new line character, only EOF.&lt;BR /&gt;
So increasing the value of the &lt;CODE&gt;time_before_close&lt;/CODE&gt; parameter could fix the problem. Except that the last event would be delayed for the specified time, as there won't be a new event after the last one. Therefore we will also need to use &lt;CODE&gt;MUST_BREAK_AFTER&lt;/CODE&gt; to ensure the last event can be reported immediately:&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;inputs.conf&lt;/STRONG&gt;&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
[monitor://D:\LogFiles\Test]&lt;BR /&gt;
disabled = false&lt;BR /&gt;
host = MyHost&lt;BR /&gt;
index = test&lt;BR /&gt;
whitelist = ^.&lt;EM&gt;.log$&lt;BR /&gt;
sourcetype = mySourcetype&lt;BR /&gt;
time_before_close = 300&lt;BR /&gt;
&lt;/EM&gt;&lt;/PRE&gt;&lt;EM&gt;props.conf&lt;/EM&gt;*&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
[mySourcetype]&lt;BR /&gt;
CHARSET = CP1252&lt;BR /&gt;
BREAK_ONLY_BEFORE_DATE  = false&lt;BR /&gt;
BREAK_ONLY_BEFORE       = [Start]&lt;BR /&gt;
MUST_BREAK_AFTER        = [End]&lt;BR /&gt;
MAX_EVENTS              = 1000000000&lt;BR /&gt;
TIME_PREFIX             = ([\r\n]|\s)timestamp="&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 64&lt;BR /&gt;
&lt;/PRE&gt;&lt;BR /&gt;
Now events are only reported after 300 seconds. I assumed the Forwarder waits for the specified time before reading new events. So to confirm my assumptions, I checked the FileStatus as described in &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/Data/Troubleshoottheinputprocess" target="_blank"&gt;3&lt;/A&gt;. Strangely enough, immediately after I add complete and partial events to my log file, the file position increases and the percent field goes up to 100. So new content is immediately processed, tough events do not show up in Splunk Web (and are not added to the Event count of the index).&lt;/P&gt;

&lt;H4&gt;References&lt;/H4&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:03:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Events-Delayed-Not-Split-Correctly/m-p/161099#M32656</guid>
      <dc:creator>krdo</dc:creator>
      <dc:date>2020-09-28T19:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Events Delayed / Not Split Correctly</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Events-Delayed-Not-Split-Correctly/m-p/161100#M32657</link>
      <description>&lt;P&gt;There is an excellent wiki that tells more than most people can grok:&lt;BR /&gt;
&lt;A href="http://wiki.splunk.com/Community:HowIndexingWorks"&gt;http://wiki.splunk.com/Community:HowIndexingWorks&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 16:13:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Events-Delayed-Not-Split-Correctly/m-p/161100#M32657</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-12-05T16:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Events Delayed / Not Split Correctly</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Events-Delayed-Not-Split-Correctly/m-p/161101#M32658</link>
      <description>&lt;P&gt;Thanks a lot - that's exactly what I was looking for.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 06:36:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Events-Delayed-Not-Split-Correctly/m-p/161101#M32658</guid>
      <dc:creator>krdo</dc:creator>
      <dc:date>2017-12-06T06:36:05Z</dc:date>
    </item>
  </channel>
</rss>

