<?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: Universal forwarder is truncating/adding extra line breaks to events output over TCP in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/222571#M43643</link>
    <description>&lt;P&gt;Oh, sorry, for some reason I didn't register that Logstash was another product (which is basically a fork of ELK, right?). What you may want to do is run a Heavy Forwarder so you can collect the data and then forward it on via syslog. Which I don't think you can do from a UF. You should be able to register the Enterprise instance as either the free license or the forwarding license since I assume you are not paying for Splunk since you are using ELK. Just make sure to turn off indexing on your Heavy Forwarder and have it dump the data via syslog to ELK.&lt;/P&gt;

&lt;P&gt;Otherwise I think I am getting outside my depth here since I am not familiar enough with ELK to help further.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Nov 2015 19:59:22 GMT</pubDate>
    <dc:creator>fairje</dc:creator>
    <dc:date>2015-11-10T19:59:22Z</dc:date>
    <item>
      <title>Why is our universal forwarder is truncating/adding extra line breaks to events output over TCP?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/222566#M43638</link>
      <description>&lt;P&gt;We have a universal forwarder set up to forward incoming messages to logstash, TCP -&amp;gt; forwarder -&amp;gt; TCP:&lt;/P&gt;
&lt;P&gt;outputs.conf:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;[tcpout] 
defaultGroup = logstash

[tcpout:logstash]
server=localhost:7777 
sendCookedData = false 
useACK = true
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And inputs.conf:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; [tcp://:9997] 
 sourcetype=_json

 [monitor://$SPLUNK_HOME/var/log/splunk/metrics.log]
 disabled = true

 [monitor://$SPLUNK_HOME/var/log/splunk/splunkd.log]
 disabled = true

 [monitor://$SPLUNK_HOME/var/log/splunk/license_audit.log]
 disabled = true
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If we connect our load tester directly to logstash, then our messages appear correctly formatted. If we go via the universal formatter then messages are coming through with extra line breaks. It's as if Splunk isn't able to tell where one event stops and another begins.&lt;/P&gt;
&lt;P&gt;Interestingly, if we send the same event multiple times, it seems to get truncated at the same point each time. All our messages originating from the load testing tool are json formatted, newline seperated. We have also tried terminating messages with EOT characters but to no avail.&lt;/P&gt;
&lt;P&gt;What could be causing this? Is there a key piece of information/documentation we are missing?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 14:18:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/222566#M43638</guid>
      <dc:creator>petehmrc</dc:creator>
      <dc:date>2022-08-04T14:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Universal forwarder is truncating/adding extra line breaks to events output over TCP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/222567#M43639</link>
      <description>&lt;P&gt;What is in your &lt;CODE&gt;props.conf&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 16:37:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/222567#M43639</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-09T16:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Universal forwarder is truncating/adding extra line breaks to events output over TCP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/222568#M43640</link>
      <description>&lt;P&gt;I don't currently have any overrides other than the default. I had assumed that as the universal forwarder does not parse the data, props.conf was not relevant but I've just googled it and read to the contrary.&lt;/P&gt;

&lt;P&gt;Is there a particular setting you think we should apply?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 16:42:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/222568#M43640</guid>
      <dc:creator>petehmrc</dc:creator>
      <dc:date>2015-11-09T16:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Universal forwarder is truncating/adding extra line breaks to events output over TCP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/222569#M43641</link>
      <description>&lt;P&gt;I think you want the props.conf on the receiving server (not the forwarder), to specify your newline character as the end of the log. The default for this is a regex pattern on "\r\n", but depending on how the log comes in this may not be the case. Below is a snippet from the props.conf specification file:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1/admin/Propsconf"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1/admin/Propsconf&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LINE_BREAKER = &amp;lt;regular expression&amp;gt;
* Specifies a regex that determines how the raw text stream is broken into
  initial events, before line merging takes place. (See the SHOULD_LINEMERGE
  attribute, below)
* Defaults to ([\r\n]+), meaning data is broken into an event for each line,
  delimited by any number of carriage return or newline characters.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You might also be able to get the data to cooperate on the forwarder itself by specifying that the type of data is "JSON" see this section in the props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* This feature and all of its settings apply at input time, when data is
  first read by Splunk.  The setting is used on a Splunk system that has
  configured inputs acquiring the data.

# Special characters for Structured Data Header Extraction:
# Some unprintable characters can be described with escape sequences. The
# attributes that can use these characters specifically mention that
# capability in their descriptions below.
# \f : form feed       byte: 0x0c
# \s : space           byte: 0x20
# \t : horizontal tab  byte: 0x09
# \v : vertical tab    byte: 0x0b

INDEXED_EXTRACTIONS = &amp;lt; CSV|W3C|TSV|PSV|JSON &amp;gt;
* Tells Splunk the type of file and the extraction and/or parsing method
  Splunk should use on the file.
  CSV  - Comma separated value format
  TSV  - Tab-separated value format
  PSV  - pipe "|" separated value format
  W3C  - W3C Extended Extended Log File Format
  JSON - JavaScript Object Notation format
* These settings default the values of the remaining settings to the
  appropriate values for these known formats.
* Defaults to unset.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So you can either fix this on the receiving side or the sending side.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 20:37:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/222569#M43641</guid>
      <dc:creator>fairje</dc:creator>
      <dc:date>2015-11-09T20:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Universal forwarder is truncating/adding extra line breaks to events output over TCP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/222570#M43642</link>
      <description>&lt;P&gt;As I mentioned in the question, we aren't forwarding on to splunk, but logstash. Secondly, we are using a universal forwarder... we have tried your suggestion in props.conf but I don't think this is checked by UF as it does not parse the data. Either way it did not resolve the problem : /&lt;/P&gt;

&lt;P&gt;When I say messages are being truncated, I mean that the forwarder is adding &lt;EM&gt;extra&lt;/EM&gt; line breaks in... I'm guessing it fills up some kind of buffer before flushing everything it has out as a single message perhaps? As such we can't use any workarounds that rely on line breaks.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2015 10:50:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/222570#M43642</guid>
      <dc:creator>petehmrc</dc:creator>
      <dc:date>2015-11-10T10:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Universal forwarder is truncating/adding extra line breaks to events output over TCP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/222571#M43643</link>
      <description>&lt;P&gt;Oh, sorry, for some reason I didn't register that Logstash was another product (which is basically a fork of ELK, right?). What you may want to do is run a Heavy Forwarder so you can collect the data and then forward it on via syslog. Which I don't think you can do from a UF. You should be able to register the Enterprise instance as either the free license or the forwarding license since I assume you are not paying for Splunk since you are using ELK. Just make sure to turn off indexing on your Heavy Forwarder and have it dump the data via syslog to ELK.&lt;/P&gt;

&lt;P&gt;Otherwise I think I am getting outside my depth here since I am not familiar enough with ELK to help further.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2015 19:59:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/222571#M43643</guid>
      <dc:creator>fairje</dc:creator>
      <dc:date>2015-11-10T19:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Universal forwarder is truncating/adding extra line breaks to events output over TCP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/222572#M43644</link>
      <description>&lt;P&gt;No worries, your help was much appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2015 10:19:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/222572#M43644</guid>
      <dc:creator>petehmrc</dc:creator>
      <dc:date>2015-11-11T10:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Universal forwarder is truncating/adding extra line breaks to events output over TCP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/607632#M105490</link>
      <description>&lt;P&gt;Years later, and I'm experiencing the same problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Were you able to fix this?&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2022 07:48:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/607632#M105490</guid>
      <dc:creator>dorlevi</dc:creator>
      <dc:date>2022-07-31T07:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Universal forwarder is truncating/adding extra line breaks to events output over TCP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/607635#M105491</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248152"&gt;@dorlevi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you tired setting EVENT_BREAKER in props.conf on the UF? You'd also need to set&amp;nbsp;EVENT_BREAKER_ENABLE = true and it might be worth looking at setting TRUNCATE if you have large events.&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I'm assuming you're forwarding to something other than Splunk).&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jamie&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2022 08:21:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/607635#M105491</guid>
      <dc:creator>jamie00171</dc:creator>
      <dc:date>2022-07-31T08:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Universal forwarder is truncating/adding extra line breaks to events output over TCP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/607640#M105492</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just tried adding&amp;nbsp;&lt;SPAN&gt;EVENT_BREAKER_ENABLE = true, as well as also trying to add TRUNCATE = 0 in a different test, to no avial.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm basically trying to simply forward a logfile, unaltered, to a 3rd party tool, and am seeing what appears to be random line breaks in the file, sometimes even in the middle of a word.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So far my config is -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;outputs.conf&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[tcpout:fastlane]
server = host.docker.internal:6996
sendCookedData = false&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;inputs.conf&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[monitor:///opt/splunkforwarder/etc/splunk.version]
_TCP_ROUTING = default-autolb-group

[monitor:///opt/splunkforwarder/var/log/splunk/metrics.log]
_TCP_ROUTING = default-autolb-group

[monitor:///opt/splunkforwarder/var/log/splunk/splunkd.log]
_TCP_ROUTING = default-autolb-group

[monitor:///var/log/test_file.log]
disabled = false
sourcetype = my_source_type
_TCP_ROUTING = fastlane&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And after you suggestion, added the following to props.conf&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[my_source_type]
EVENT_BREAKER_ENABLE = true
EVENT_BREAKER = ([\r\n]+)
TRUNCATE = 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, no success in having just the plain file being forwarded, as mentioned I'm having random line breaks throughout.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running this UF in a docker container on my local machine as I'm still testing this, but I doubt this is an issue here because if I'm using the same UF to forward the file to my local Splunk Enterprise node, I'm seeing the events exactly as they should be.&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2022 09:27:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/607640#M105492</guid>
      <dc:creator>dorlevi</dc:creator>
      <dc:date>2022-07-31T09:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Universal forwarder is truncating/adding extra line breaks to events output over TCP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/608260#M105551</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/211432"&gt;@jamie00171&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Upon further testing, it seems that doing&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EVENT_BREAKER_ENABLE = true
EVENT_BREAKER = "([\r\n]+)"&lt;/LI-CODE&gt;&lt;P&gt;Works, but only if accompanied by also doing&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;force_local_processing = true&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are the event breaker flags ignored if there's no force local processing?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 12:02:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-our-universal-forwarder-is-truncating-adding-extra-line/m-p/608260#M105551</guid>
      <dc:creator>dorlevi</dc:creator>
      <dc:date>2022-08-04T12:02:40Z</dc:date>
    </item>
  </channel>
</rss>

