# Autodiscover + Docker decoding JSON: EOF

**URL:** https://discuss.elastic.co/t/autodiscover-docker-decoding-json-eof/126615
**Category:** Beats
**Tags:** filebeat
**Created:** [April 3, 2018, 5:14pm UTC](https://discuss.elastic.co/t/autodiscover-docker-decoding-json-eof/126615 "2018-04-03T17:14:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![strowi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/strowi/32/29219_2.png) [@strowi](https://discuss.elastic.co/u/strowi)
#### Post date: [April 3, 2018, 5:14pm UTC](https://discuss.elastic.co/t/autodiscover-docker-decoding-json-eof/126615/1 "2018-04-03T17:14:14Z")

</div>

Hi,

i am trying to get some nginx-logs from the container shipped to elasticsearch... but i am getting some json-decoding errors using filebeat 6.2.3.  
Weird thing is, these errors apper for already running containers.  
If i start a new nginx:alpine container the logs appear just fine...

```auto
filebeat.autodiscover:
  providers:
    - type: docker
      templates:
        - condition:
            contains:
              docker.container.name: "nginx"
          config:
            - module: nginx
              access:
                prospector:
                  type: docker
                  containers.stream: stdout
                  containers.ids:
                    - "${data.docker.container.id}"
              error:
                prospector:
                  type: docker
                  containers.stream: stderr
                  containers.ids:
                    - "${data.docker.container.id}"

```

```auto
|2018-04-03T19:10:23.701+0200|INFO|log/harvester.go:216|Harvester started for file: /var/lib/docker/containers/5ca40e68ff704127f3a8994912c67cdea77c50d9d6a4a99dd6e2fa5f3b433a19/5ca40e68ff704127f3a8994912c67cdea77c50d9d6a4a99dd6e2fa5f3b433a19-json.log|
|---|---|---|---|
|2018-04-03T19:10:23.701+0200|INFO|log/harvester.go:216|Harvester started for file: /var/lib/docker/containers/5ca40e68ff704127f3a8994912c67cdea77c50d9d6a4a99dd6e2fa5f3b433a19/5ca40e68ff704127f3a8994912c67cdea77c50d9d6a4a99dd6e2fa5f3b433a19-json.log|
|2018-04-03T19:10:23.701+0200|ERROR|log/harvester.go:243|Read line error: decoding docker JSON: EOF; File: %!(EXTRA string=/var/lib/docker/containers/5ca40e68ff704127f3a8994912c67cdea77c50d9d6a4a99dd6e2fa5f3b433a19/5ca40e68ff704127f3a8994912c67cdea77c50d9d6a4a99dd6e2fa5f3b433a19-json.log)|
|2018-04-03T19:10:23.701+0200|ERROR|log/harvester.go:243|Read line error: decoding docker JSON: EOF; File: %!(EXTRA string=/var/lib/docker/containers/5ca40e68ff704127f3a8994912c67cdea77c50d9d6a4a99dd6e2fa5f3b433a19/5ca40e68ff704127f3a8994912c67cdea77c50d9d6a4a99dd6e2fa5f3b433a19-json.log)|

```

---

<div class="post-metadata">

### Author: ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)
#### Post date: [April 5, 2018, 8:54am UTC](https://discuss.elastic.co/t/autodiscover-docker-decoding-json-eof/126615/2 "2018-04-05T08:54:38Z")

</div>

What version of docker are you using? Is the problem easily reproducible or it only happens from time to time?

---

<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: [May 3, 2018, 8:54am UTC](https://discuss.elastic.co/t/autodiscover-docker-decoding-json-eof/126615/3 "2018-05-03T08:54:42Z")

</div>

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