# Logstash file output. Why having empty lines?

**URL:** <https://discuss.elastic.co/t/logstash-file-output-why-having-empty-lines/118480>\
**Category:** Logstash\
**Created:** [February 5, 2018, 3:04pm UTC](https://discuss.elastic.co/t/logstash-file-output-why-having-empty-lines/118480 "2018-02-05T15:04:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [February 5, 2018, 3:04pm UTC](https://discuss.elastic.co/t/logstash-file-output-why-having-empty-lines/118480/1 "2018-02-05T15:04:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [February 5, 2018, 3:50pm UTC](https://discuss.elastic.co/t/logstash-file-output-why-having-empty-lines/118480/2 "2018-02-05T15:50:30Z")

</div>

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 ""**

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 5, 2018, 3:50pm UTC](https://discuss.elastic.co/t/logstash-file-output-why-having-empty-lines/118480/3 "2018-03-05T15:50:41Z")

</div>

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