# Csv output is not working

**URL:** <https://discuss.elastic.co/t/csv-output-is-not-working/71554>\
**Category:** Logstash\
**Created:** [January 13, 2017, 6:13pm UTC](https://discuss.elastic.co/t/csv-output-is-not-working/71554 "2017-01-13T18:13:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ctangirala](https://avatars.discourse-cdn.com/v4/letter/c/9d8465/32.png) [@ctangirala](https://discuss.elastic.co/u/ctangirala)\
**Post date:** [January 13, 2017, 6:13pm UTC](https://discuss.elastic.co/t/csv-output-is-not-working/71554/1 "2017-01-13T18:13:49Z")

</div>

I am trying to use elasticsearch input and CSV output to query my index and output a CSV file with data. However, the CSV file does't have the any data after logstash finishes processing. All I see is timestamp and %{message} (see below)

Is this a bug?

2017-01-13T17:58:27.540Z %{host} %{message}2017-01-13T17:58:39.205Z %{host} %{message}2017-01-13T17:58:39.207Z %{host} %{message}2017-01-13T17:58:39.208Z %{host} %{message}2017-01-13T17:58:39.209Z %{host} %{message}2017-01-13T17:58:39.213Z %{host} %{message}2017-01-13T17:58:39.214Z %{host} %{message}2017-01-13T17:58:39.216Z %{host} %{message}2017-01-13T17:58:39.217Z %{host} %{message}2017-01-13T17:58:39.218Z %{host} %{message}2017-01-13T17:58:39.220Z %{host} %{message}2017-01-13T17:58:39.221Z %{host} %{message}2017-01-13T17:58:39.222Z %{host} %{message}2017-01-13T17:58:39.224Z %{host} %{message}2017-01-13T17:58:39.225Z %{host} %{message}2017-01-13T17:58:39.226Z %{host} %{message}2017-01-13T17:58:39.228Z %{host} %{message}2017-01-13T17:58:39.230Z %{host} %{message}2017-01-13T17:58:39.230Z %{host} %{message}2017-01-13T17:58:39.231Z %{host} %{message}2017-01-13T17:58:39.232Z %{host} %{message}2017-01-13T17:58:39.235Z %{host} %{message}2017-01-13T17:58:39.235Z %{host} %{message}2017-01-13T17:58:39.236Z %{host} %{message}2017-01-13T17:58:39.237Z %{host} %{message}2017-01-13T17:58:39.238Z %{host} %{message}2017-01-13T17:58:39.239Z %{host} %{message}2017-01-13T17:58:39.241Z %{host} %{message}2017-01-13T17:58:39.244Z %{host} %{message}2017-01-13T17:58:39.246Z %{host} %{message}2017-01-13T17:58:39.247Z %{host} %{message}2017-01-13T17:58:39.249Z %{host} %{message}2017-01-13T17:58:39.250Z %{host} %{message}2017-01-13T17:58:39.250Z %{host} %{message}2017-01-13T17:58:39.253Z %{host} %{message}2017-01-13T17:58:39.254Z %{host} %{message}2017-01-13T17:58:39.254Z %{host} %{message}2017-01-13T17:58:39.255Z %{host} %{message}2017-01-13T17:58:39.255Z %{host} %{message}2017-01-13T17:58:39.257Z %{host} %{message}2017-01-13T17:58:39.257Z %{host} %{message}2017-01-13T17:58:39.258Z %{host} %{message}2017-01-13T17:58:39.258Z %{host} %{message}2017-01-13T17:58:50.077Z %{host} %{message}2017-01-13T17:58:50.095Z %{host} %{message}2017-01-13T17:58:50.097Z %{host} %{message}2017-01-13T17:58:50.098Z %{host} %{message}2017-01-13T17:58:50.100Z %{host} %{message}2017-01-13T17:58:50.114Z %{host} %{message}2017-01-13T17:58:50.115Z %{host} %{message}2017-01-13T17:58:50.119Z %{host} %{message}2017-01-13T17:58:50.119Z %{host} %{message}2017-01-13T17:59:09.152Z %{host} %{message}2017-01-13T17:59:13.141Z %{host} %{message}%

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)\
**Post date:** [January 13, 2017, 10:42pm UTC](https://discuss.elastic.co/t/csv-output-is-not-working/71554/2 "2017-01-13T22:42:08Z")

</div>

Can you please post a minimal test case for this?

---

<div class="post-metadata">

**Author:** ![ctangirala](https://avatars.discourse-cdn.com/v4/letter/c/9d8465/32.png) [@ctangirala](https://discuss.elastic.co/u/ctangirala)\
**Post date:** [January 15, 2017, 2:48pm UTC](https://discuss.elastic.co/t/csv-output-is-not-working/71554/3 "2017-01-15T14:48:45Z")

</div>

Here is the logstash config example. The JDBC input simply does a SELECT on users table.

input {  
jdbc {  
jdbc\_driver\_library =\> "ojdbc6.jar"  
jdbc\_driver\_class =\> "Java::oracle.jdbc.OracleDriver"  
jdbc\_connection\_string =\> "${DB\_CONNECTION\_STRING}"  
jdbc\_user =\> "${DB\_USER}"  
jdbc\_password =\> "${DB\_PASSWORD}"  
jdbc\_fetch\_size =\> 10000  
statement\_filepath =\> "/conf/user.sql"  
lowercase\_column\_names =\> false  
}  
}  
filter {  
mutate {  
rename =\> { "URL" =\> "url" }  
}  
}  
output {  
csv {  
path =\> "/conf/users.csv"  
columns = ["firstName", "lastName", "employeeID", "phone", "url"]  
}  
}

---

<div class="post-metadata">

**Author:** ![val](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/val/32/138203_2.png) [@val](https://discuss.elastic.co/u/val)\
**Post date:** [February 9, 2017, 5:18am UTC](https://discuss.elastic.co/t/csv-output-is-not-working/71554/4 "2017-02-09T05:18:11Z")

</div>

If you're using Logstash 5.x then it might be because of this [open issue](https://github.com/logstash-plugins/logstash-output-csv/issues/10). If that's the case, you may downgrade to Logstash 2.x until this gets resolved.

---

<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 9, 2017, 5:18am UTC](https://discuss.elastic.co/t/csv-output-is-not-working/71554/5 "2017-03-09T05:18:53Z")

</div>

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