# Logstash CSV output generation

**URL:** <https://discuss.elastic.co/t/logstash-csv-output-generation/290285>\
**Category:** Logstash\
**Created:** [November 26, 2021, 12:55pm UTC](https://discuss.elastic.co/t/logstash-csv-output-generation/290285 "2021-11-26T12:55:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elk\_chaser](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elk_chaser/32/76982_2.png) [@elk\_chaser](https://discuss.elastic.co/u/elk_chaser)\
**Post date:** [November 26, 2021, 12:55pm UTC](https://discuss.elastic.co/t/logstash-csv-output-generation/290285/1 "2021-11-26T12:55:48Z")

</div>

I have a logstash csv output report generation config, that I run as a separate logstash instance as and when it is required. I have many csv report to be generated and for each, I have one config file. Everytime I run the logstash instance, it takes its own time to start and generates report and shuts down for each csv report. My ask is, is there a way to keep a separate instance running and only trigger as many csv generator config, so as to minimize the time to start the logstash instance? TIA  
example logstash config follows here.  
``Preformatted text`

```auto
input {
Elasticsearch {
hosts => "localhost:9200"
index => "test-log_2021-11-17"
query => '
{
"query": {
"bool": {
"must": [
{
"exists": {
"field": "respCode"
}
}
]

'
}
}
output {
csv {
fields => ["uuid", "gtid", "respTxURI", "txTime", "respCode", "dataSize", "userId"]
path => "/tmp/csv_report_1.csv"
}
}
`

```

/usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/report\_1.conf `Preformatted text` (I have 100s of reports to be generated)

---

<div class="post-metadata">

**Author:** ![AquaX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aquax/32/92006_2.png) [@AquaX](https://discuss.elastic.co/u/AquaX)\
**Post date:** [December 3, 2021, 5:03pm UTC](https://discuss.elastic.co/t/logstash-csv-output-generation/290285/2 "2021-12-03T17:03:03Z")

</div>

Set a schedule for your Elasticsearch input so that it keeps running on a regular basis. That way Logstash will stay up and running and will generate a report every pre-defined interval.

> **[Elasticsearch input plugin | Logstash Reference \[7.15\] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-elasticsearch.html#_scheduling)**

---

<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:** [December 31, 2021, 5:03pm UTC](https://discuss.elastic.co/t/logstash-csv-output-generation/290285/3 "2021-12-31T17:03:25Z")

</div>

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