# Run additional options for logstash in docker container

**URL:** <https://discuss.elastic.co/t/run-additional-options-for-logstash-in-docker-container/249578>\
**Category:** Logstash\
**Created:** [September 22, 2020, 7:34pm UTC](https://discuss.elastic.co/t/run-additional-options-for-logstash-in-docker-container/249578 "2020-09-22T19:34:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinci](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vinci](https://discuss.elastic.co/u/vinci)\
**Post date:** [September 22, 2020, 7:34pm UTC](https://discuss.elastic.co/t/run-additional-options-for-logstash-in-docker-container/249578/1 "2020-09-22T19:34:43Z")

</div>

Hello,

I would like to run logstash as such:

```auto
logstash -e 'input { stdin {}} output { stdout {}}'

```

but within a docker container, using the logstash official image. Is there a way I can do this? I simply want to test the way it it processes some input text initially, but I don't want to install it directly on the host, because then I need to make sure that the java version is correct and so on, and so forth. So running it within a container would be much more practical.

The problem is that it doesn't work as such, because the default command in the container is a huge java executable, which probably doesn't allow for additional options in a 'normal way'.  
Any ideas?

What I've tried thus far is changing the logstash.yml to:

```auto
input {
   stdin {}
}

output {
   stdout {}
}

```

But I get:

> line 3: cannot unmarshal !!str `input {...` into map[string]interface {}

---

<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:** [September 22, 2020, 8:18pm UTC](https://discuss.elastic.co/t/run-additional-options-for-logstash-in-docker-container/249578/2 "2020-09-22T20:18:10Z")

</div>

> [@vinci](#):
>
> What I've tried thus far is changing the logstash.yml

The input and output sections should be in the logstash.conf, not the logstash.yml.

---

<div class="post-metadata">

**Author:** ![vinci](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vinci](https://discuss.elastic.co/u/vinci)\
**Post date:** [September 22, 2020, 8:31pm UTC](https://discuss.elastic.co/t/run-additional-options-for-logstash-in-docker-container/249578/3 "2020-09-22T20:31:59Z")

</div>

Thanks for the tip!

So now what I've done is delete the contents of logstash.yml, so that it doesn't try to connect to any elasticsearch instance and put the input/output content into logstash.conf.  
It doesn't complain anymore, but I also cannot input any strings while attaching to the container as follows:

```auto
docker run -it --name logstash -v logstashconfig:/usr/share/logstash/config docker.elastic.co/logstash/logstash:7.7.1

```

It simply ignores whatever I write. So I'm not sure what I'm doing wrong.  
Maybe it would be easier to use curl? And if yes, what default settings am I supposed to use for logstash.conf?

---

<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 20, 2020, 8:32pm UTC](https://discuss.elastic.co/t/run-additional-options-for-logstash-in-docker-container/249578/4 "2020-10-20T20:32:03Z")

</div>

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