# The JSON filter can extract empty field names, which are then unusable by Logstash

**URL:** <https://discuss.elastic.co/t/the-json-filter-can-extract-empty-field-names-which-are-then-unusable-by-logstash/271963>\
**Category:** Logstash\
**Created:** [May 3, 2021, 10:45am UTC](https://discuss.elastic.co/t/the-json-filter-can-extract-empty-field-names-which-are-then-unusable-by-logstash/271963 "2021-05-03T10:45:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nico127](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@nico127](https://discuss.elastic.co/u/nico127)\
**Post date:** [May 3, 2021, 10:45am UTC](https://discuss.elastic.co/t/the-json-filter-can-extract-empty-field-names-which-are-then-unusable-by-logstash/271963/1 "2021-05-03T10:45:00Z")

</div>

Hi, I've found a situation where the JSON filter and valid JSON can cause unusable Logstash events. It comes from 2 facts:

1. An empty string is a valid JSON key, as explained for example in this [stackoverflow answer](https://stackoverflow.com/a/58917082/3740920).
2. It isn't possible to access fields with empty names in Logstash.

The obvious solution of course is "use ruby"; but it seems like Logstash should be able to handle correctly parsed, valid JSON (not arguing whether it is sane). Is there something I missed?

---

<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:** [May 31, 2021, 10:45am UTC](https://discuss.elastic.co/t/the-json-filter-can-extract-empty-field-names-which-are-then-unusable-by-logstash/271963/2 "2021-05-31T10:45:33Z")

</div>

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