<?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 How do you custom line break multi-line logs in props.conf? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441844#M77031</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;My log file is like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[#|2019-01-31 11:04:34,712 | ERROR | some data 
Logging important message |#]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In my props.conf(SplunkUniversalForwarder\etc\system\default), I have tried the following options:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::...\\data\\log\\*.log]
sourcetype = appcustom
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;[appcustom]&lt;BR /&gt;
&lt;STRONG&gt;Option 1&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;BREAK_ONLY_BEFORE =|#]
SHOULD_LINEMERGE =true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Option 2&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SHOULD_LINEMERGE =false
LINE_BREAKER=([\r\n]+)(|#])([\r\n]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Option 3&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;MUST_NOT_BREAK_AFTER=^[#
MUST_BREAK_AFTER=#]
SHOULD_LINEMERGE= true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If my log file contains all the lines from "[#|" to "|#]" 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;&lt;STRONG&gt;First event:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[#|2019-01-31 11:04:34,712 | ERROR | some data 
Logging important message |#]
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:
[#|2019-01-31 11:04:34,712 | ERROR | some 
and then couple of seconds later these additional lines are appended:
data Logging important message |#]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this case I would get these events instead:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;First event:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[#|2019-01-31 11:04:34,712 | ERROR | some 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Second event:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;data Logging important message |#]
&lt;/CODE&gt;&lt;/PRE&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 one multiline event regardless of when or what my app writes to the log file. Is this possible via configuration changes in Splunk?&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;

&lt;P&gt;Senthil&lt;/P&gt;</description>
    <pubDate>Fri, 01 Feb 2019 17:26:02 GMT</pubDate>
    <dc:creator>sduraisamy</dc:creator>
    <dc:date>2019-02-01T17:26:02Z</dc:date>
    <item>
      <title>How do you custom line break multi-line logs in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441844#M77031</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;My log file is like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[#|2019-01-31 11:04:34,712 | ERROR | some data 
Logging important message |#]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In my props.conf(SplunkUniversalForwarder\etc\system\default), I have tried the following options:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::...\\data\\log\\*.log]
sourcetype = appcustom
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;[appcustom]&lt;BR /&gt;
&lt;STRONG&gt;Option 1&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;BREAK_ONLY_BEFORE =|#]
SHOULD_LINEMERGE =true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Option 2&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SHOULD_LINEMERGE =false
LINE_BREAKER=([\r\n]+)(|#])([\r\n]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Option 3&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;MUST_NOT_BREAK_AFTER=^[#
MUST_BREAK_AFTER=#]
SHOULD_LINEMERGE= true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If my log file contains all the lines from "[#|" to "|#]" 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;&lt;STRONG&gt;First event:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[#|2019-01-31 11:04:34,712 | ERROR | some data 
Logging important message |#]
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:
[#|2019-01-31 11:04:34,712 | ERROR | some 
and then couple of seconds later these additional lines are appended:
data Logging important message |#]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this case I would get these events instead:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;First event:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[#|2019-01-31 11:04:34,712 | ERROR | some 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Second event:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;data Logging important message |#]
&lt;/CODE&gt;&lt;/PRE&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 one multiline event regardless of when or what my app writes to the log file. Is this possible via configuration changes in Splunk?&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;

&lt;P&gt;Senthil&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 17:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441844#M77031</guid>
      <dc:creator>sduraisamy</dc:creator>
      <dc:date>2019-02-01T17:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do you custom line break multi-line logs in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441845#M77032</link>
      <description>&lt;P&gt;@sduraisamy : firstly, do not make any changes to /etc/system/default, try to use /etc/system/local.&lt;BR /&gt;
do you have the props on your indexers as well..??&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 17:58:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441845#M77032</guid>
      <dc:creator>prakash007</dc:creator>
      <dc:date>2019-02-01T17:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do you custom line break multi-line logs in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441846#M77033</link>
      <description>&lt;P&gt;Thanks @prakash007. No. I am changing the forwarder configuration only. Should i add the configuration changes  in /etc/system/local/props.conf?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 18:04:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441846#M77033</guid>
      <dc:creator>sduraisamy</dc:creator>
      <dc:date>2019-02-01T18:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do you custom line break multi-line logs in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441847#M77034</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;You should add this configuration to the props.conf on the indexers (or the heavy forwarders if you are sending your data through a a heavy forwarder)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[appcustom]
SHOULD_LINEMERGE=false
LINE_BREAKER= ([\r\n]+)\[#
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I hope this helps&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 18:13:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441847#M77034</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-02-01T18:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do you custom line break multi-line logs in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441848#M77035</link>
      <description>&lt;P&gt;@sduraisamy : best practice is to NOT touch any file under /etc/system/default, you can either make changes to /etc/system/local or create a custom-app if needed... &lt;BR /&gt;
Above configs do not work on forwarders, you should configure them on indexers...&lt;BR /&gt;
this should work on your indexers...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   props.conf
    [appcustom]
    SHOULD_LINEMERGE = true
    NO_BINARY_CHECK = true
    TIME_FORMAT = %Y-%m-%d %H:%M:%S,%3N
    TIME_PREFIX = ^\[\#\|
    MAX_TIMESTAMP_LOOKAHEAD = 23
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;-if you think splunk is closing the file while the log is still updating, try something like this in your inputs.conf on your forwarder...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    time_before_close = &amp;lt;integer&amp;gt;
    * The amount of time, in seconds, that the file monitor must wait for
      modifications before closing a file after reaching an End-of-File
      (EOF) marker.
    * Tells the input not to close files that have been updated in the
      past 'time_before_close' seconds.
    * Default: 3.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 18:14:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441848#M77035</guid>
      <dc:creator>prakash007</dc:creator>
      <dc:date>2019-02-01T18:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do you custom line break multi-line logs in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441849#M77036</link>
      <description>&lt;P&gt;Thanks @prakash007. I will try this out on Indexers.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 19:29:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441849#M77036</guid>
      <dc:creator>sduraisamy</dc:creator>
      <dc:date>2019-02-01T19:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do you custom line break multi-line logs in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441850#M77037</link>
      <description>&lt;P&gt;Thanks @chrisyoungerjds. I will try this out on Indexers.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 19:29:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441850#M77037</guid>
      <dc:creator>sduraisamy</dc:creator>
      <dc:date>2019-02-01T19:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do you custom line break multi-line logs in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441851#M77038</link>
      <description>&lt;P&gt;Always use &lt;CODE&gt;Option 2&lt;/CODE&gt; whenever possible.  It is &lt;EM&gt;way&lt;/EM&gt; more efficient than the others. So try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[appcustom]
SHOULD_LINEMERGE=false
LINE_BREAKER= ([\r\n]+)\[#\|\d{4}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Feb 2019 21:38:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-custom-line-break-multi-line-logs-in-props-conf/m-p/441851#M77038</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-01T21:38:17Z</dc:date>
    </item>
  </channel>
</rss>

