# Confused with running Logstash in docker

**URL:** https://discuss.elastic.co/t/confused-with-running-logstash-in-docker/87752
**Category:** Logstash
**Created:** [May 31, 2017, 1:37pm UTC](https://discuss.elastic.co/t/confused-with-running-logstash-in-docker/87752 "2017-05-31T13:37:42Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Jaxon\_Kochel](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@Jaxon\_Kochel](https://discuss.elastic.co/u/Jaxon_Kochel)
#### Post date: [May 31, 2017, 1:37pm UTC](https://discuss.elastic.co/t/confused-with-running-logstash-in-docker/87752/1 "2017-05-31T13:37:42Z")

</div>

Hello everyone,

I'm looking for some instruction with how to run logstash in docker. I can get elasticsearch running okay but then im not sure how I'm supposed to start logstash. I'm also kinda confused about how I link my local system to the container.

if anyone could help me out with the commands that would be very, very helpful to me. I'm running this one a windows machine. I know I need to do something along the lines of "docker run -d --name logstash -p 5400:5400 -v (confused here)"

So how do I get my docker conf file into the container?  
Secondly, how does the container see my log files?

My conf file is currently sitting in the directory C:\Users\e-team\Documents\elk\_docker  
in my conf file the path Im using to read my logs is "C:/Users/e-team/Documents/ELK/logs/\*\*/logs/\*.log"

So how do I get the container to see all of this information?

---

<div class="post-metadata">

### Author: ![Gaurav\_Singh1](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@Gaurav\_Singh1](https://discuss.elastic.co/u/Gaurav_Singh1)
#### Post date: [May 31, 2017, 2:16pm UTC](https://discuss.elastic.co/t/confused-with-running-logstash-in-docker/87752/2 "2017-05-31T14:16:45Z")

</div>

Use this command and if this not works , try to get an idea from this what I am trying to do (mount the directories from windows to the docker container)

docker run -d --name logstash -p 5044:5044 --link elasticsearch:elasticsearch -v /c/Users/e-team/Documents/ELK/logs/\*\*/logs/:/tmp/ -v /c/Users/e-team/Documents/elk\_docker/:/etc/logstash/conf.d/ logsta  
sh -f /etc/logstash/conf.d/logstash.conf

---

<div class="post-metadata">

### Author: ![Jaxon\_Kochel](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@Jaxon\_Kochel](https://discuss.elastic.co/u/Jaxon_Kochel)
#### Post date: [May 31, 2017, 2:30pm UTC](https://discuss.elastic.co/t/confused-with-running-logstash-in-docker/87752/3 "2017-05-31T14:30:22Z")

</div>

okay so docker seems to be accepting this command, how do I know if it is actually doing anything? I tried going out to localhost:9200/\_cat/indices to see if it was loading stuff but for some reason its asking for a username and a password to get in? its never done that before

edit: i got the username and password. doesnt look like my index i specified in my .conf file is there

Second edit for more info:

my conf file output section is setup like this, i know this works on my local machine but im not all too sure about it being in docker ocntainers, do i need to modify this?

```
output { #The output section tells where the output will go
    elasticsearch{ #Output will be going to elasticsearch  
      hosts => ["localhost:9200"] #name of the index that the output will be stored
      index => "finalindex"
    }
    stdout { codec => rubydebug } #Outputs the contents of the message to the command prompt
}
```

---

<div class="post-metadata">

### Author: ![Gaurav\_Singh1](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@Gaurav\_Singh1](https://discuss.elastic.co/u/Gaurav_Singh1)
#### Post date: [May 31, 2017, 2:43pm UTC](https://discuss.elastic.co/t/confused-with-running-logstash-in-docker/87752/4 "2017-05-31T14:43:59Z")

</div>

What is your local machine from which you are calling logs and conf file ? Is it Windows or linux ?

---

<div class="post-metadata">

### Author: ![Jaxon\_Kochel](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@Jaxon\_Kochel](https://discuss.elastic.co/u/Jaxon_Kochel)
#### Post date: [May 31, 2017, 2:44pm UTC](https://discuss.elastic.co/t/confused-with-running-logstash-in-docker/87752/5 "2017-05-31T14:44:37Z")

</div>

My host machine that contains the logs and config file and is running the containers is windows

---

<div class="post-metadata">

### Author: ![Gaurav\_Singh1](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@Gaurav\_Singh1](https://discuss.elastic.co/u/Gaurav_Singh1)
#### Post date: [May 31, 2017, 2:49pm UTC](https://discuss.elastic.co/t/confused-with-running-logstash-in-docker/87752/6 "2017-05-31T14:49:51Z")

</div>

Everytime you mount a directory from windows host to docker machine , your file might experience some changes.  
Kindly check and if it's yes then use command : dos2unix   
to make that file usable for docker ...seems like you are facing the same issue

---

<div class="post-metadata">

### Author: ![Jaxon\_Kochel](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@Jaxon\_Kochel](https://discuss.elastic.co/u/Jaxon_Kochel)
#### Post date: [May 31, 2017, 2:54pm UTC](https://discuss.elastic.co/t/confused-with-running-logstash-in-docker/87752/7 "2017-05-31T14:54:10Z")

</div>

Now I'm getting this error

`ERROR logstash.agent - Pipeline aborted due to error {:exception=>#<ArgumentError: File paths must be absolute, relative path specified: C:/Users/e-team/Documents/ELK/logs/**/logs/*.log>`

Not sure how im supposed to read all the different files if i cant use a relative path?

---

<div class="post-metadata">

### Author: ![Gaurav\_Singh1](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@Gaurav\_Singh1](https://discuss.elastic.co/u/Gaurav_Singh1)
#### Post date: [June 1, 2017, 9:06am UTC](https://discuss.elastic.co/t/confused-with-running-logstash-in-docker/87752/8 "2017-06-01T09:06:37Z")

</div>

Well, as far as i know need to give absolute path , path doesn't include the file name as I can see u have given .

---

<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: [June 29, 2017, 9:07am UTC](https://discuss.elastic.co/t/confused-with-running-logstash-in-docker/87752/9 "2017-06-29T09:07:11Z")

</div>

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