# JSON parse error, Could not set field 'ip' on object '\<hostname\>.\<domain\>.com' to value '10.XXX.XX.XX'.This is probably due to trying to set a field like \[foo\]\[bar\] = someValuewhen \[foo\] is not either a map or a string"

**URL:** <https://discuss.elastic.co/t/json-parse-error-could-not-set-field-ip-on-object-hostname-domain-com-to-value-10-xxx-xx-xx-this-is-probably-due-to-trying-to-set-a-field-like-foo-bar-somevaluewhen-foo-is-not-either-a-map-or-a-string/313928>\
**Category:** Logstash\
**Created:** [September 7, 2022, 9:41pm UTC](https://discuss.elastic.co/t/json-parse-error-could-not-set-field-ip-on-object-hostname-domain-com-to-value-10-xxx-xx-xx-this-is-probably-due-to-trying-to-set-a-field-like-foo-bar-somevaluewhen-foo-is-not-either-a-map-or-a-string/313928 "2022-09-07T21:41:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enzo\_baker](https://avatars.discourse-cdn.com/v4/letter/e/71e660/32.png) [@Enzo\_baker](https://discuss.elastic.co/u/Enzo_baker)\
**Post date:** [September 7, 2022, 9:41pm UTC](https://discuss.elastic.co/t/json-parse-error-could-not-set-field-ip-on-object-hostname-domain-com-to-value-10-xxx-xx-xx-this-is-probably-due-to-trying-to-set-a-field-like-foo-bar-somevaluewhen-foo-is-not-either-a-map-or-a-string/313928/1 "2022-09-07T21:41:51Z")

</div>

Hi,

Error message -

```auto

JSON parse error, Could not set field 'ip' on object '<hostname>.<domain>.com' to value '10.XXX.XX.XX'.This is probably due to trying to set a field like [foo][bar] = someValuewhen [foo] is not either a map or a string", :exception=>Java::OrgLogstash::Accessors::InvalidFieldSetException,

Logstash config:

# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.

input {
  http {
    port => 5555
	codec => "json_lines" -- Also tried "json"
  }
}

output {
  elasticsearch {
    hosts => ["http://localhost:9200"]
	index => "index_a"
	#index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
    user => "elastic"
	password => "xxxxxx"
  }
}

```

**[2022-09-06T07:51:14,981][ERROR][logstash.codecs.json][main][8389505e72a806ebe48e512a58ff4661cbcb99033c706ae098ddc4ff93614cde] JSON parse error, original data now in message field {:message=\>"Could not set field 'ip' on object '..com' to value '10.XXX.XX.X'.This is probably due to trying to set a field like [foo][bar] = someValuewhen [foo] is not either a map or a string", :exception=\>Java::OrgLogstash::Accessors::InvalidFieldSetException, :data=\>"[{"type":"ace\_message","ibm\_product":"IBM App Connect Enterprise","ibm\_recordtype":"log","host":"..com","module":"ABC.","ibm\_serverName":"ABC","ibm\_processName":"DataFlowEngine","ibm\_processId":"15644","ibm\_threadId":"15644","ibm\_datetime":"2022-09-06T02:50:14.015975","loglevel":"INFO","message":"2152I: Configuration message received. ","ibm\_message\_detail":"2152I: Configuration message received.**

Pls advise what I am missing here.

---

<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 5, 2022, 9:42pm UTC](https://discuss.elastic.co/t/json-parse-error-could-not-set-field-ip-on-object-hostname-domain-com-to-value-10-xxx-xx-xx-this-is-probably-due-to-trying-to-set-a-field-like-foo-bar-somevaluewhen-foo-is-not-either-a-map-or-a-string/313928/2 "2022-10-05T21:42:41Z")

</div>

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