# Logstash config file on docker

**URL:** https://discuss.elastic.co/t/logstash-config-file-on-docker/122194
**Category:** Logstash
**Created:** [March 2, 2018, 5:45am UTC](https://discuss.elastic.co/t/logstash-config-file-on-docker/122194 "2018-03-02T05:45:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Gaurav\_Agarwal](https://avatars.discourse-cdn.com/v4/letter/g/9fc29f/32.png) [@Gaurav\_Agarwal](https://discuss.elastic.co/u/Gaurav_Agarwal)
#### Post date: [March 2, 2018, 5:45am UTC](https://discuss.elastic.co/t/logstash-config-file-on-docker/122194/1 "2018-03-02T05:45:53Z")

</div>

I am new to both elk and docker  
Wanted to know how could I run the config file of logstash and link it to elasticsearch for further analysis.  
I have all the images pulled on the server and elasticsearch and kibana are running fine.

I used this command  
docker run -h logstash --name logstash --link elasticsearch:elasticsearch -it --rm -v "$PWD":/config-dir logstash -f /config-dir/filename.conf

For this it is creating an endpoint API well and fine but there is an error with respect to connection refused from elasticsearch.

Regards  
gaurav

---

<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: [March 2, 2018, 7:13am UTC](https://discuss.elastic.co/t/logstash-config-file-on-docker/122194/2 "2018-03-02T07:13:44Z")

</div>

> For this it is creating an endpoint API well and fine but there is an error with respect to connection refused from elasticsearch.

Please never ever paraphrase error messages. Use copy/paste so we can see the exact message. Details matter!

---

<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 30, 2018, 7:13am UTC](https://discuss.elastic.co/t/logstash-config-file-on-docker/122194/3 "2018-03-30T07:13:59Z")

</div>

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