# Decode\_json\_fields not

**URL:** https://discuss.elastic.co/t/decode-json-fields-not/349367
**Category:** Beats
**Tags:** filebeat
**Created:** [December 14, 2023, 12:10pm UTC](https://discuss.elastic.co/t/decode-json-fields-not/349367 "2023-12-14T12:10:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Areeb\_Siddiqui](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/areeb_siddiqui/32/130017_2.png) [@Areeb\_Siddiqui](https://discuss.elastic.co/u/Areeb_Siddiqui)
#### Post date: [December 14, 2023, 12:10pm UTC](https://discuss.elastic.co/t/decode-json-fields-not/349367/1 "2023-12-14T12:10:24Z")

</div>

I am using filebeat on kubernetes. My filebeat.yaml looks like this:

```auto
filebeat.autodiscover:
  providers:
    - type: kubernetes
      node: ${NODE_NAME}
      templates:
      - condition:
          equals:
            kubernetes.labels.app: app-name
        config:
          - type: container
            paths:
            - /var/log/containers/*${data.kubernetes.container.id}.log
            processors:
              - decode_json_fields:
                  fields: ["message"]
                  process_array: true
                  max_depth: 1
                  target: "Message"
                  overwrite_keys: false
                  add_error_key: true

```

However on my kibana dashboard in Mesasge Coloum I am having logs like this:

```auto
{
  "log.level": "info",
  "@timestamp": "2023-12-14T11:59:24.638Z",
  "log.origin": {
    "file.name": "filename",
    "file.line": 270
  },
  "message": "Received Request",
  "trace.id": "xxx",
  "transaction.id": "xxx",
  "user.name": "username",
  "ecs.version": "1.6.0"
}

```

But I want something like this

```auto
[Info] "Received Request"

```

How can I achieve this?

Note: The log file contains the log in the following format on k8s node.

directory: `/var/log/containers/*${data.kubernetes.container.id}.log`

```auto
2023-12-14T12: 13: 59.872959737Z stdout F {
{
  "log.level": "info",
  "@timestamp": "2023-12-14T11:59:24.638Z",
  "log.origin": {
    "file.name": "filename",
    "file.line": 270
  },
  "message": "Received Request",
  "trace.id": "xxx",
  "transaction.id": "xxx",
  "user.name": "username",
  "ecs.version": "1.6.0"
}

```

---

<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: [January 11, 2024, 2:11pm UTC](https://discuss.elastic.co/t/decode-json-fields-not/349367/2 "2024-01-11T14:11:03Z")

</div>

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