# Csv output failing in logstash 5.1.2

**URL:** <https://discuss.elastic.co/t/csv-output-failing-in-logstash-5-1-2/73751>\
**Category:** Logstash\
**Created:** [February 2, 2017, 8:08pm UTC](https://discuss.elastic.co/t/csv-output-failing-in-logstash-5-1-2/73751 "2017-02-02T20:08:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![data](https://avatars.discourse-cdn.com/v4/letter/d/cab0a1/32.png) [@data](https://discuss.elastic.co/u/data)\
**Post date:** [February 2, 2017, 8:08pm UTC](https://discuss.elastic.co/t/csv-output-failing-in-logstash-5-1-2/73751/1 "2017-02-02T20:08:45Z")

</div>

Facing issues with csv output in logstash 5.1.2  
output {  
csv {  
fields =\> ["time", "level", "fun", "data", "thread"]  
path =\> "/data/outputcsv.csv"  
}  
}  
generates output as sequence of strings - %{host} %{message}%{host} %{message}%{host} %{message}  
While the file output generates proper output  
file {  
path =\> "/data/output"  
}  
Any help?

---

<div class="post-metadata">

**Author:** ![jdca](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@jdca](https://discuss.elastic.co/u/jdca)\
**Post date:** [February 8, 2017, 12:05am UTC](https://discuss.elastic.co/t/csv-output-failing-in-logstash-5-1-2/73751/2 "2017-02-08T00:05:54Z")

</div>

I had the same issue, but the file output works as an alternative:

```
file {
    codec => line { format => %{field1},"%{field2}"}
    path => "/path/to/data_export.csv"
}
```

---

<div class="post-metadata">

**Author:** ![Dom-nik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dom-nik/32/13243_2.png) [@Dom-nik](https://discuss.elastic.co/u/Dom-nik)\
**Post date:** [February 10, 2017, 12:44pm UTC](https://discuss.elastic.co/t/csv-output-failing-in-logstash-5-1-2/73751/3 "2017-02-10T12:44:41Z")

</div>

It's a known bug and there's an open issue for it: [https://github.com/logstash-plugins/logstash-output-csv/issues/10](https://github.com/logstash-plugins/logstash-output-csv/issues/10)

As a workaround you may:

- downgrade to Logstash 2.x until this gets resolved,
- use the file output instead
- modify the plugin's code according to the github discussion...

---

<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 10, 2017, 12:44pm UTC](https://discuss.elastic.co/t/csv-output-failing-in-logstash-5-1-2/73751/4 "2017-03-10T12:44:50Z")

</div>

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