# Filebeats via docker refusing to decode JSON

**URL:** https://discuss.elastic.co/t/filebeats-via-docker-refusing-to-decode-json/215261
**Category:** Beats
**Tags:** docker, filebeat
**Created:** [January 16, 2020, 7:40am UTC](https://discuss.elastic.co/t/filebeats-via-docker-refusing-to-decode-json/215261 "2020-01-16T07:40:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![spamoom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spamoom/32/60869_2.png) [@spamoom](https://discuss.elastic.co/u/spamoom)
#### Post date: [January 16, 2020, 7:40am UTC](https://discuss.elastic.co/t/filebeats-via-docker-refusing-to-decode-json/215261/1 "2020-01-16T07:40:57Z")

</div>

I'm trying to configure filebeats to decode JSON messages put onto the docker logs (I have this setup using standard filebeats using the same config and it works without issue). It appears that the co.elastic.logs/enabled label is followed, however co.elastic.logs/json.\* labels are completely ignored. Running filebeats with debug logging yields nothing to do with JSON at all.

Snippet of my docker-compose file:

```
php:
build:
context: .
dockerfile: docker/php
volumes:
- .:/var/www:cached
labels:
- "co.elastic.logs/enabled=true"
- "co.elastic.logs/json.message_key=message"
- "co.elastic.logs/json.keys_under_root=true"
- "co.elastic.logs/json.add_error_key=true"
filebeats:
image: "docker.elastic.co/beats/filebeat:7.5.0"
user: root
volumes:
- ./docker/filebeat.docker.yml:/usr/share/filebeat/filebeat.yml:ro
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
BEATS_CLOUD_ID: "x:x"
BEATS_CLOUD_AUTH: "x:x"

```

And my filebeat.docker.yml:

```
filebeat.config:
modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false

logging:
metrics:
enabled: false
to_stderr: true
level: debug

json.keys_under_root: true

filebeat.autodiscover:
providers:
- type: docker
hints.enabled: true
hints.default_config.enabled: false

processors:
- add_cloud_metadata: ~

cloud.id: '${BEATS_CLOUD_ID:}'
cloud.auth: '${BEATS_CLOUD_AUTH:}'
```

---

<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: [January 16, 2020, 4:39pm UTC](https://discuss.elastic.co/t/filebeats-via-docker-refusing-to-decode-json/215261/2 "2020-01-16T16:39:59Z")

</div>

Hi @spamoom and welcome to discuss 🙂

Not all configuration settings are exposed as hints, you can find the full list of supported hints [in the documentation](https://www.elastic.co/guide/en/beats/filebeat/7.5/configuration-autodiscover-hints.html).  
JSON options are not supported yet, but they are going to be in the upcoming 7.6.0 release, after [this change](https://github.com/elastic/beats/pull/14208).

In the meantime you can try to use the [`raw` hint](https://www.elastic.co/guide/en/beats/filebeat/7.5/configuration-autodiscover-hints.html#_co_elastic_logsraw), that allows to define any configuration encoded as JSON.

---

<div class="post-metadata">

### Author: ![spamoom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spamoom/32/60869_2.png) [@spamoom](https://discuss.elastic.co/u/spamoom)
#### Post date: [January 16, 2020, 6:03pm UTC](https://discuss.elastic.co/t/filebeats-via-docker-refusing-to-decode-json/215261/3 "2020-01-16T18:03:16Z")

</div>

Thanks @jsoriano!

I hadn't even considered that JSON support hadn't been added in my version! 🤦‍♂️

I'll give that a go and come back to you with my findings!

Thanks again

---

<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 13, 2020, 6:03pm UTC](https://discuss.elastic.co/t/filebeats-via-docker-refusing-to-decode-json/215261/4 "2020-02-13T18:03:27Z")

</div>

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