Logstash file output. Why having empty lines?


#1

Hi,

I am using logstash to annonymize my logfiles and output them as new logfile using logstash's file output.

My output config looks like this:

output
{
	file
	{
		codec => line { format => "%{customerNameFP} %{userNameFP} %{sessionId}  %{logTime} de_de - %{processingTime}%{payload}"}
		path => "q:/useractions_anonymous.log"
	}
}

But my output looks like this:

918826505 1302784860 1x1a111111 1x1 1x1d1 1x1  02.12.2017 23:00:01 de_de - 0.0 DB_LWDR_LIST: XSQL-Filter: 'LWDR_ID IN (xxx)', [NO SORT], 0...END (PageSize: INFINITE), , Fetched: 1, 15 ms, ok.

1376897975 31820156 1x1a11111d 1x1 1x1e1 1x1  02.12.2017 23:00:00 de_de - 0.0 DB_TMLIST: XSQL-Filter: 'TM_ID IN (xxx)', [NO SORT], 0...END (PageSize: INFINITE), , Fetched: 1, 15 ms, , VALUES ==> 0...END (PageSize: INFINITE), , Fetched: 3, 0 ms, *OK*

3076985510 87088329 1x1a111da1 1x1 1x1fc 1x1  02.12.2017 23:00:01 de_de - 0.9 DB_LWVD_LIST: SERVER-SIDE VOA-ACCUMULATION, Acc-Mode 1, Fetch-Method 1: (SAMPLED - NO/PARTIAL TIME RANGE), XSQL-Filter: '(((LWVD_LATEST_DATE >= "01.12.2017 14:41:37" AND LWVD_LATEST_DATE <= "02.12.2017 23:00:00") AND LWVD_DATA_CODE IN ('VOA')) AND TM_ID IN (xxx))', [NO SORT], #0...#4000 (PageSize: 4001), , Fetched: 0, 905 ms

1376897975 31820156 1x1a11111d 1x1 1x1e1 1x1  02.12.2017 23:00:02 de_de - 0.0 DB_TMLIST: XSQL-Filter: 'TM_ID IN (xxx)', [NO SORT], 0...END (PageSize: INFINITE), , Fetched: 1, 16 ms, , VALUES ==> 0...END (PageSize: INFINITE), , Fetched: 3, 0 ms, *OK*

How can I get rid of the empty lines between each correct line?
Using logstash 6.1.2 in this case.

Thanks, Andreas


#2

found it.
checking my output with notepad++ and I saw an additional at the end of my lines.
Seems if it came with my last field I added. At least it works now when I do a gsub over my payload field:
replace \r with ""


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.