Issues with encoding

I came across a major issue( atleast in my case ). The issue is as explained below and I am assuming it has to do with some sort of encoding.

The logs in my case which are being parsed contain special characters and such. See below the actual line from my log:


See below the output received on logstash/redis:


As seen above in the output message it has skipped some portion of the input from beginning and another concerning part is that the input message is not in the actual sequence. It has stitched the message string in some random fashion. Also the output message is in encoded form.I tried encoding set to plain, utf-8, utf-16be-bom etc but in vain. All I want is that the input message parsed to be returned as it is in the output. How could I do that?

So would you describe as lines are partially truncated? We've identified an issue in rc2 with very long log lines being incomplete. Updating to most recent nightlies should solve it.

Link for nightlies:

@vinod8427 Can you post your config here? What is the encoding of your files?

The config used is as below:

- /var/log/sonus/sbx/evlog/*.ACT
encoding: plain # Also tried utf-8 & utf-16be-bom
ignore_older: 20s
scan_frequency: 5s
harvester_buffer_size: 2000000
hosts: ["localhost:5044"]

I have taken the input message and have tried to explain how the output message has been formed from it (See comments section in the image).

so utf-16be-bom is not supported anymore. You can either try utf-16be (default utf16 over network) or utf-16le (default utf16 on windows) .

Having the original log file it would be somewhat easier. Which operating system are you running on? Who is producing this log file (csv SIP CDRs?) ? Which locale is configured?

digging into the lines I found this:



now 'truncated' one:


Interestingly the ';' in first line is replaced by '\u003c' in unicode. The replacement is kinda correct, as '\u003c' stands for '<'. But no idea why string contains '<' character. From this point everything get's lost until the address: sip:sipp@

If you use plain, the bytes are read as is. It is the json encoder escaping bad byte sequences. The decoder (configured by encoding) is responsible for reading files and translating all symbols into valid utf-8 for the json encoder not escaping wrong sequences.

I am using Linux. The log files are SIP CDR's and generated by running some scripts. Locale used is IST. BTW I tried using utf-16be and its the same result I notice. Accordingly I guess I must be using plain encoding but as you mentioned the json encoder is messing things up. Logstash shipper used to handle this fine but I would like to migrate to filebeat instead. Please let me know if you require any further information from my end.

@vinod8427 Can you send me one of these log files?

So I created some tests locally about reading and writing said line and tests with multiple lines of random length, but can not reproduce the issue. Also json encoder seems to be fine with the line. Just press 'Run' on the sample encoding your line to json:

Maybe it's some interplay with other lines in your log file?

can you get us the output of

$ locale


locale output is as below:

Shortly will be sending a mail with the attached log file. Sorry for the delay.

Sent a mail to Nicolas with the log attached. Steffen, could you message me your mail id?

@vinod8427 Thanks, got the e-mail. I forwarded it to Steffen. We will have a look and get back to you.

@vinod8427 I'm currently trying to reproduce this with the log file. I'm using FB -> LS -> ES. What is your setup? You list Redis above? Can you post your LS config?

I tried with both redis and LS and both received the same output. My LS config is pretty simple for the time being which is as below:

input {
#redis { host =>"localhost" port =>"6379" data_type => "list" key =>"filebeat" threads => 2 }
beats {
port => 5044
filter {
grok { match => { "message" => "^START|^STOP|^ATTEMPT|^INTERMEDIATE|^REBOOT" } }
output {
stdout { codec=>rubydebug }

BTW my current config is FB->LS. If it goes well it would be FB->LS->ES

Can you also post your exact operating system? I think I have to test it on the same OS.

Does this happen for all events (means as soon as you start filebeat) or does it only happen after a certain time?

Its Debian OS 7.8. It happens everytime. Some events has slightly different outputs and never it is correct but the problem statement still holds the same for most of it.

Forgot to add to the list above: Exact LS and ES version.