# Stopping LogStash after processing the data

**URL:** <https://discuss.elastic.co/t/stopping-logstash-after-processing-the-data/250749>\
**Category:** Logstash\
**Created:** [October 2, 2020, 1:11am UTC](https://discuss.elastic.co/t/stopping-logstash-after-processing-the-data/250749 "2020-10-02T01:11:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roman\_Kagan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roman_kagan/32/63832_2.png) [@Roman\_Kagan](https://discuss.elastic.co/u/Roman_Kagan)\
**Post date:** [October 2, 2020, 1:11am UTC](https://discuss.elastic.co/t/stopping-logstash-after-processing-the-data/250749/1 "2020-10-02T01:11:03Z")

</div>

Hello:

I am creating my own conf file that I supply on command line to LogStash - it works like a charm, however it does not stop after processing all the data. I do not expect to generate new files in some folder, nor need to run the LogStash as a daemon. How can I instruct LogStash to stop after processing the whole file?

This is the video I followed: [https://www.youtube.com/watch?v=rKy4sFbIZ3U&t=958s](https://www.youtube.com/watch?v=rKy4sFbIZ3U&t=958s)

This is my config:

```auto
input {
  file {
    path => "/home/romankagan/practice-1562x.csv"
    start_position => "beginning"
    sincedb_path => "NULL"
  }
}
filter {
      csv {
        columns => ["authorName","createdDate","dateOfService","deleted","documentName","draft","id","ownerUserId","patientId","practice","sections","text"]
     }
     mutate{convert => ["ownerUserId","integer"]}
     mutate{convert => ["patientId","integer"]}
     mutate{convert => ["draft","boolean"]}
     mutate{convert => ["id","integer"]}
     mutate{convert => ["practice","integer"]}
     mutate{convert => ["deleted","boolean"]}
     mutate{remove_field => ["message"]}
     date {
        match => [ "createdDate", "yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd HH:mm:ss","MMM dd yyyy HH:mm:ss",
              "MMM d yyyy HH:mm:ss", "ISO8601" ]
      }
      date {
        match => [ "dateOfService", "yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd HH:mm:ss","MMM dd yyyy HH:mm:ss",
              "MMM d yyyy HH:mm:ss", "ISO8601" ]
      }
    }
output {
  elasticsearch { 
  hosts => ["localhost:9200"] 
  index => "practice-1562xx"
  }
  stdout { codec => rubydebug }
 }

```

This is how I start the logstash:

```auto
bin/logstash -f logstash-simple.conf

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 2, 2020, 1:40am UTC](https://discuss.elastic.co/t/stopping-logstash-after-processing-the-data/250749/2 "2020-10-02T01:40:00Z")

</div>

You will need to use `cat` + `stdin` to do this, there's no way to do it with the config you have.

---

<div class="post-metadata">

**Author:** ![Roman\_Kagan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roman_kagan/32/63832_2.png) [@Roman\_Kagan](https://discuss.elastic.co/u/Roman_Kagan)\
**Post date:** [October 2, 2020, 8:57pm UTC](https://discuss.elastic.co/t/stopping-logstash-after-processing-the-data/250749/3 "2020-10-02T20:57:46Z")

</div>

Could you please give an example of such command?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [October 2, 2020, 9:15pm UTC](https://discuss.elastic.co/t/stopping-logstash-after-processing-the-data/250749/4 "2020-10-02T21:15:02Z")

</div>

Something like

```
cat /path/to/file | logstash -e '{input { stdin {} }'
```

---

<div class="post-metadata">

**Author:** ![Roman\_Kagan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roman_kagan/32/63832_2.png) [@Roman\_Kagan](https://discuss.elastic.co/u/Roman_Kagan)\
**Post date:** [October 2, 2020, 9:58pm UTC](https://discuss.elastic.co/t/stopping-logstash-after-processing-the-data/250749/5 "2020-10-02T21:58:36Z")

</div>

> [@Badger](#):
>
> `cat /path/to/file | logstash -e '{input { stdin {} }'`

Thank you soooooo much. It works like a charm!

---

<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:** [October 30, 2020, 9:58pm UTC](https://discuss.elastic.co/t/stopping-logstash-after-processing-the-data/250749/6 "2020-10-30T21:58:39Z")

</div>

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