# Json Target doesn't work

**URL:** <https://discuss.elastic.co/t/json-target-doesnt-work/207445>\
**Category:** Logstash\
**Created:** [November 12, 2019, 6:07am UTC](https://discuss.elastic.co/t/json-target-doesnt-work/207445 "2019-11-12T06:07:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kollp](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@kollp](https://discuss.elastic.co/u/kollp)\
**Post date:** [November 12, 2019, 6:07am UTC](https://discuss.elastic.co/t/json-target-doesnt-work/207445/1 "2019-11-12T06:07:17Z")

</div>

Hello,

I am using logstash 7.3.1.

I use an http input plugin to get data into logstash. I get an JSON payload which looks like

```
{"version":"1.1","host":"myHost","short_message":"Test Dev","full_message":"Testlog Message for Elastic","level":1,"_server_name":"localhost","_server_ip":"127.0.0.1","_server_apppool":"FSCPool","_user_id":"xx\\yyyy","_coo_env":"123456","_level_name":"INFO","_url_args":"&cx=Y52EHGmnn-PiUVV2&tz=-60&xhr=1"}

```

Based on the attribute "host" in the Json I have to do some logic, the problem seems that the input plugin already provides a field named "host".  
In case I use the json plugin as followed, the information from the input json (except the host attribute) is available. The host field still contains the value from the http input.

```
json {
		source => "message"
     }

```

I came accross the target parameter in the json plugin  
json {  
source =\> "message"  
target =\> "parsed\_json"  
}

As it is indicated in the documentation the parsed information should not be placed in the root but in the "parsed\_json".  
Basically the json is parsed correctly (except the host) but all information are placed in the root and not in "parsed\_json"

Is there something I have overlooked or did I missunderstood something?

Beside the issue with the target - is there another solution for my duplicate host problem?  
I also tried to remove, rename,... the host field from the input but nothing changed.

Thanks in advance for your help  
Regards

---

<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:** [December 10, 2019, 6:07am UTC](https://discuss.elastic.co/t/json-target-doesnt-work/207445/2 "2019-12-10T06:07:20Z")

</div>

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