# BUG: JSON Filter Plugin needs target?

**URL:** <https://discuss.elastic.co/t/bug-json-filter-plugin-needs-target/148171>\
**Category:** Logstash\
**Created:** [September 11, 2018, 3:52pm UTC](https://discuss.elastic.co/t/bug-json-filter-plugin-needs-target/148171 "2018-09-11T15:52:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![isaacsanders](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/isaacsanders/32/34805_2.png) [@isaacsanders](https://discuss.elastic.co/u/isaacsanders)\
**Post date:** [September 11, 2018, 3:52pm UTC](https://discuss.elastic.co/t/bug-json-filter-plugin-needs-target/148171/1 "2018-09-11T15:52:44Z")

</div>

This log line from the most recent version of this plugin:

```auto
Parsed JSON object/hash requires a target configuration option {:source=>"unparsed", :raw=>" "}

```

Contradicts the documentation here:  
[https://www.elastic.co/guide/en/logstash/current/plugins-filters-json.html#plugins-filters-json-target](https://www.elastic.co/guide/en/logstash/current/plugins-filters-json.html#plugins-filters-json-target)

Which source of information is meant to be wrong? The documentation or the code/log line?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 11, 2018, 6:41pm UTC](https://discuss.elastic.co/t/bug-json-filter-plugin-needs-target/148171/2 "2018-09-11T18:41:48Z")

</div>

`target` is mandatory iff the JSON string parses into anything but an object (hash). In this case it appears you're trying to parse a string containing whitespace, which doesn't produce an object.

---

<div class="post-metadata">

**Author:** ![isaacsanders](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/isaacsanders/32/34805_2.png) [@isaacsanders](https://discuss.elastic.co/u/isaacsanders)\
**Post date:** [September 11, 2018, 6:53pm UTC](https://discuss.elastic.co/t/bug-json-filter-plugin-needs-target/148171/3 "2018-09-11T18:53:00Z")

</div>

Would it respond by tagging the message with the failure field?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 11, 2018, 8:40pm UTC](https://discuss.elastic.co/t/bug-json-filter-plugin-needs-target/148171/4 "2018-09-11T20:40:41Z")

</div>

I'm not sure I get the question, but If `target` isn't set when it needs to be set the event will be tagged with the tags in `tag_on_failure`.

---

<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:** [October 9, 2018, 8:40pm UTC](https://discuss.elastic.co/t/bug-json-filter-plugin-needs-target/148171/5 "2018-10-09T20:40:44Z")

</div>

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