# Filebeat not filtering data according to fields in decode\_json\_fields

**URL:** <https://discuss.elastic.co/t/filebeat-not-filtering-data-according-to-fields-in-decode-json-fields/164866>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [January 18, 2019, 9:37pm UTC](https://discuss.elastic.co/t/filebeat-not-filtering-data-according-to-fields-in-decode-json-fields/164866 "2019-01-18T21:37:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshaygawali](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@akshaygawali](https://discuss.elastic.co/u/akshaygawali)\
**Post date:** [January 18, 2019, 9:37pm UTC](https://discuss.elastic.co/t/filebeat-not-filtering-data-according-to-fields-in-decode-json-fields/164866/1 "2019-01-18T21:37:31Z")

</div>

In my filebeat configuration, I am trying pass json file to filebeat and want specific fields in the json to filtered and passed to elasticsearch. I am not using logstash. Below is my filebeat config:

```
- type: log
  paths:
     - /var/log/test4*.json
  json.keys_under_root: true
  json.add_error_key: true
  processors:
    - decode_json_fields:
        fields: ["header"]
        process_array: false
         max_depth: 1

```

Example of my json file:

> {"header1": "nissan"},  
> {"header": "mazda"},  
> {"header": "honda","cars":["civic", "accord", "clarity"] }

I would like only the following to sent to Elasticsearch.

> {"header": "mazda"},  
> {"header": "honda"}

---

<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 15, 2019, 9:37pm UTC](https://discuss.elastic.co/t/filebeat-not-filtering-data-according-to-fields-in-decode-json-fields/164866/2 "2019-02-15T21:37:37Z")

</div>

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