# Decode\_json\_fields.fields: \["message"\] decodes JSON logs with "logs"

**URL:** https://discuss.elastic.co/t/decode-json-fields-fields-message-decodes-json-logs-with-logs/197712
**Category:** Beats
**Tags:** filebeat
**Created:** [September 2, 2019, 3:25pm UTC](https://discuss.elastic.co/t/decode-json-fields-fields-message-decodes-json-logs-with-logs/197712 "2019-09-02T15:25:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![olivierwa](https://avatars.discourse-cdn.com/v4/letter/o/aeb1de/32.png) [@olivierwa](https://discuss.elastic.co/u/olivierwa)
#### Post date: [September 2, 2019, 3:25pm UTC](https://discuss.elastic.co/t/decode-json-fields-fields-message-decodes-json-logs-with-logs/197712/1 "2019-09-02T15:25:04Z")

</div>

Hello,  
I am running an Elastic+Kibana+Filebeat docker stack to monitor containers. Everything is working fine but there is something that I do not understand and wasted many hours on it to debug.

The log files under /var/lib/docker/containers are in this format:

```auto
{"log":"{\"asctime\": \"2019-09-02 15:07:45,420\", \"filename\": \"_internal.py\", \"funcName\": \"_log\", \"levelname\": \"INFO\", \"lineno\": 122, \"message\": \" * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)\", \"name\": \"werkzeug\", \"thread\": 140275406490472, \"threadName\": \"MainThread\"}\r\n","stream":"stdout","time":"2019-09-02T15:07:45.4207396Z"}

```

Essentially it is a JSON with 3 top fields:

```auto
{
"log": {...},
"stream:": "stdout",
"time":
}

```

So at the root, the JSON does not contain any "message" field. Yet in order to decode this, my filebeat configuration needs to indicate:

```auto
filebeat.autodiscover:
  providers:
    - type: docker
      templates:
        - config:
            - type: container
              format: docker
              paths:
                - "/var/lib/docker/containers/${data.docker.container.id}/*.log"
              processors:
                - decode_json_fields:
                    **fields: ["message"]**
                    target: ""
                    overwrite_keys: true         

```

What does this "message" mean? **What is the relation with fields:["message"] and the log file ?** since the log file does not contain any message field.

Thanks,  
Olivier

---

<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: [September 30, 2019, 3:28pm UTC](https://discuss.elastic.co/t/decode-json-fields-fields-message-decodes-json-logs-with-logs/197712/2 "2019-09-30T15:28:30Z")

</div>

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