# JSON Filter fails on valid key names

**URL:** https://discuss.elastic.co/t/json-filter-fails-on-valid-key-names/232244
**Category:** Logstash
**Created:** [May 12, 2020, 2:32pm UTC](https://discuss.elastic.co/t/json-filter-fails-on-valid-key-names/232244 "2020-05-12T14:32:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![davehatma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davehatma/32/29322_2.png) [@davehatma](https://discuss.elastic.co/u/davehatma)
#### Post date: [May 12, 2020, 2:32pm UTC](https://discuss.elastic.co/t/json-filter-fails-on-valid-key-names/232244/1 "2020-05-12T14:32:21Z")

</div>

I have some Kafka messages that have key names that contain reserved Logstash characters -- specifically '[" and "]". Additionally the json document also has arrays.

My Logstash pipeline is generating:

[WARN][logstash.filters.json][unilog] Exception caught in json filter {:exception=\>"Invalid FieldReference: `custom_news[0][code]`"

I would attempt to change the key names by treating the entire document as a string first and then using the JSON Filter, but with the "[" and "]" characters ALSO designating arrays in the document that is quite cumbersome and seems should be unnecessary as the key names are indeed valid for json documents.

Any help/insight as to how I can resolve this without a ton of coding would be appreciated.

Thanks.

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [May 12, 2020, 2:58pm UTC](https://discuss.elastic.co/t/json-filter-fails-on-valid-key-names/232244/2 "2020-05-12T14:58:47Z")

</div>

This is an [open issue](https://github.com/logstash-plugins/logstash-filter-json/issues/38).

---

<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: [June 9, 2020, 2:58pm UTC](https://discuss.elastic.co/t/json-filter-fails-on-valid-key-names/232244/3 "2020-06-09T14:58:52Z")

</div>

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