# Understanding running logstash container command

**URL:** <https://discuss.elastic.co/t/understanding-running-logstash-container-command/111923>\
**Category:** Logstash\
**Created:** [December 15, 2017, 8:34am UTC](https://discuss.elastic.co/t/understanding-running-logstash-container-command/111923 "2017-12-15T08:34:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marouane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marouane/32/83858_2.png) [@marouane](https://discuss.elastic.co/u/marouane)\
**Post date:** [December 15, 2017, 8:34am UTC](https://discuss.elastic.co/t/understanding-running-logstash-container-command/111923/1 "2017-12-15T08:34:10Z")

</div>

Hello every one,  
I'm working on creating the container logstash using docker run  
I found this commande and i want to understand what is means ,

docker run -d --name=logstash --restart=unless-stopped --link elasticsearch:elasticsearch -v /srv/docker/logstash/etc:/config-dir --volumes-from syslog-ng logstash:2.3 -f /config-dir/logstash.conf

/srv/docker/logstash/etc:/config-dir : i don't understand the config-dir , i'm expecting a path not this  
-f : i don't understanf the -f option why it's used

Thank you for your help

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [December 15, 2017, 10:39am UTC](https://discuss.elastic.co/t/understanding-running-logstash-container-command/111923/2 "2017-12-15T10:39:39Z")

</div>

> /srv/docker/logstash/etc:/config-dir : i don't understand the config-dir , i'm expecting a path not this

The `-v /srv/docker/logstash/etc:/config-dir` option will cause the host path /srv/docker/logstash/etc to be available as /config-dir inside the container.

> -f : i don't understanf the -f option why it's used

The `-f` option and the pathname that follows are passed to Logstash.

> **[Running Logstash from the Command Line | Logstash Reference \[8.11\] | Elastic](https://www.elastic.co/guide/en/logstash/current/running-logstash-command-line.html)**

---

<div class="post-metadata">

**Author:** ![marouane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marouane/32/83858_2.png) [@marouane](https://discuss.elastic.co/u/marouane)\
**Post date:** [December 20, 2017, 7:45am UTC](https://discuss.elastic.co/t/understanding-running-logstash-container-command/111923/3 "2017-12-20T07:45:09Z")

</div>

Thank you for your response,  
I understand now every option in the commande , but in the same time i want to ask you about the logstash config-dir.  
I want to know where exactelly i can put my config file inside the container,  
is in /etc/logstash or /usr/share/logstash/config  
Thank you.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [December 20, 2017, 8:32am UTC](https://discuss.elastic.co/t/understanding-running-logstash-container-command/111923/4 "2017-12-20T08:32:25Z")

</div>

It depends on the image you're using and how it invokes Logstash.

---

<div class="post-metadata">

**Author:** ![marouane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marouane/32/83858_2.png) [@marouane](https://discuss.elastic.co/u/marouane)\
**Post date:** [December 20, 2017, 9:05am UTC](https://discuss.elastic.co/t/understanding-running-logstash-container-command/111923/5 "2017-12-20T09:05:21Z")

</div>

I'm using logstash:2

---

<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:** [January 17, 2018, 9:05am UTC](https://discuss.elastic.co/t/understanding-running-logstash-container-command/111923/6 "2018-01-17T09:05:21Z")

</div>

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