# Issue with running Logstash in docker

**URL:** <https://discuss.elastic.co/t/issue-with-running-logstash-in-docker/323931>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [January 25, 2023, 2:34pm UTC](https://discuss.elastic.co/t/issue-with-running-logstash-in-docker/323931 "2023-01-25T14:34:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SimonIv](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@SimonIv](https://discuss.elastic.co/u/SimonIv)\
**Post date:** [January 25, 2023, 2:34pm UTC](https://discuss.elastic.co/t/issue-with-running-logstash-in-docker/323931/1 "2023-01-25T14:34:07Z")

</div>

I'm trying to run Logstash in docker with Elasticsearch as output, however there are some warnings and errors like:

- elasticsearch:9200 failed to respond
- Unable to retrieve license information from license server {:message=\>"No Available connections"}

**My actions:**

1. Elasticsearch:

```auto
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.6.0
docker run --name elasticsearch --net elastic -p 9200:9200 -it docker.elastic.co/elasticsearch/elasticsearch:8.6.0

```

Then I'm copying the http\_ca.crt

```auto
docker cp es01:/usr/share/elasticsearch/config/certs/http_ca.crt .

```

Elasticsearch is working.

1. Kibana:

```auto
docker pull docker.elastic.co/kibana/kibana:8.6.0
docker run --name kib-01 --net elastic -p 5601:5601 docker.elastic.co/kibana/kibana:8.6.0

```

Kibana is working as well.

1. Logstash:

Using this Dockerfile to create and image ( **logstash.conf** and **http\_ca.crt** are in the same dir as the Dockerfile):

```auto
FROM docker.elastic.co/logstash/logstash:8.6.0

RUN rm -f /usr/share/logstash/pipeline/logstash.conf
COPY logstash.conf /usr/share/logstash/pipeline/
COPY http_ca.crt /usr/share/logstash/pipeline/

CMD bin/logstash -f /usr/share/logstash/pipeline/logstash.conf

```

**logstash.conf** file looks like:

```auto
input {
    http {
        port => 8082
    }
}

filter {
  grok {
    match => {"message" => "%{NUMBER:custom_number}%{SPACE}%{WORD:custom_text}%{SPACE}%{GREEDYDATA:custom_rest}"}
  }
}

output {
  elasticsearch {
    hosts => ["elasticsearch:9200"]
    user => "elastic"
    password => "my-password"
    cacert => "/usr/share/logstash/pipeline/http_ca.crt"
  }
}

```

1. Then I'm building and starting Logstash in the same network:

```auto
docker build -t img-logstash .
docker run --net elastic img-logstash

```

What am I doing wrong?

---

<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:** [February 22, 2023, 2:34pm UTC](https://discuss.elastic.co/t/issue-with-running-logstash-in-docker/323931/2 "2023-02-22T14:34:16Z")

</div>

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