# Make logstash upload then exit

**URL:** <https://discuss.elastic.co/t/make-logstash-upload-then-exit/218421>\
**Category:** Logstash\
**Created:** [February 7, 2020, 11:13pm UTC](https://discuss.elastic.co/t/make-logstash-upload-then-exit/218421 "2020-02-07T23:13:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Goishin](https://avatars.discourse-cdn.com/v4/letter/g/46a35a/32.png) [@Goishin](https://discuss.elastic.co/u/Goishin)\
**Post date:** [February 7, 2020, 11:13pm UTC](https://discuss.elastic.co/t/make-logstash-upload-then-exit/218421/1 "2020-02-07T23:13:33Z")

</div>

I've got what appears to be a unique situation. I am using Kibana to dashboard test pass data after a dev commits code. Because of that, my log data isn't received in real time. I basically have a file with all my logging data in it, and now I want to upload that data to Kibana. All the stuff I read about logstash appears to be geared towards a terminate-and-stay paradigm. I've been looking at command line options to see if I can't just get logstash to upload my file to kibana and then exit. But now I'm questioning if I'm doing the right thing. Should I even be using logstash for this? Or is there a better way of dealing with my needs?

In short, what I want is to automate the upload of a completed logfile to kibana. What is the recommended way to accomplish this.

---

<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:** [February 8, 2020, 12:50am UTC](https://discuss.elastic.co/t/make-logstash-upload-then-exit/218421/2 "2020-02-08T00:50:27Z")

</div>

You could do it using a stdin input, which causes logstash to exit when it reaches EOF. That said, logstash can burn a minute of CPU time during startup, so that's pretty expensive. It may be possible with filebeat, which is lighter weight, but I believe that it also architected to run forever as a service.

That said, if you have the resources to let logstash run as a service there are a number of ways you could feed files to it from time to time. file input, curl into an http input...

---

<div class="post-metadata">

**Author:** ![Goishin](https://avatars.discourse-cdn.com/v4/letter/g/46a35a/32.png) [@Goishin](https://discuss.elastic.co/u/Goishin)\
**Post date:** [February 10, 2020, 3:59pm UTC](https://discuss.elastic.co/t/make-logstash-upload-then-exit/218421/3 "2020-02-10T15:59:02Z")

</div>

Actually, I DO have the resources to let logstash do its thing. I didn't know about the stdin mode. That sounds like my solution 😃

---

<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, 2020, 3:59pm UTC](https://discuss.elastic.co/t/make-logstash-upload-then-exit/218421/4 "2020-03-09T15:59:08Z")

</div>

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