# Want to remove filed who change his position from json response

**URL:** https://discuss.elastic.co/t/want-to-remove-filed-who-change-his-position-from-json-response/235794
**Category:** Logstash
**Created:** [June 4, 2020, 3:11pm UTC](https://discuss.elastic.co/t/want-to-remove-filed-who-change-his-position-from-json-response/235794 "2020-06-04T15:11:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ay\_Sa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ay_sa/32/69720_2.png) [@Ay\_Sa](https://discuss.elastic.co/u/Ay_Sa)
#### Post date: [June 4, 2020, 3:11pm UTC](https://discuss.elastic.co/t/want-to-remove-filed-who-change-his-position-from-json-response/235794/1 "2020-06-04T15:11:46Z")

</div>

hi i need help  
i got this error on logstash  
`<LogStash::Event:0x264d46cf>], :response=>{"index"=>{"_index"=>"shodan_data_ip_history", "_type"=>"_doc", "_id"=>"sy7ef3IBfJwC4yBc10gf", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [data.ssl.cert.serial] of type [long] in document with id 'sy7ef3IBfJwC4yBc10gf'. Preview of field's value: '272721470987025980360415388385100183350393'", "caused_by"=>{"type"=>"json_parse_exception", "reason"=>"Numeric value (272721470987025980360415388385100183350393) out of range of long (-9223372036854775808 - 9223372036854775807)\n `

i heared that the solution is to remove that field , but the probleme is that field came in many positions like this

`[data][0][ssl][cert][serial] `  
sometimes`[data][1][ssl][cert][serial]`  
..  
..  
..  
sometimes .... `[data][12][ssl][cert][serial]`  
..  
..  
how can remove it in a generic way  
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: [June 4, 2020, 3:49pm UTC](https://discuss.elastic.co/t/want-to-remove-filed-who-change-his-position-from-json-response/235794/2 "2020-06-04T15:49:58Z")

</div>

You would have to use a ruby filter. Something like [this](https://discuss.elastic.co/t/logstash-filter-mutate-remove-field-inside-of-an-array/168503/11).

---

<div class="post-metadata">

### Author: ![Ay\_Sa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ay_sa/32/69720_2.png) [@Ay\_Sa](https://discuss.elastic.co/u/Ay_Sa)
#### Post date: [June 7, 2020, 8:07am UTC](https://discuss.elastic.co/t/want-to-remove-filed-who-change-his-position-from-json-response/235794/3 "2020-06-07T08:07:35Z")

</div>

thanks for replying ... you helped find the solution

---

<div class="post-metadata">

### Author: ![Ay\_Sa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ay_sa/32/69720_2.png) [@Ay\_Sa](https://discuss.elastic.co/u/Ay_Sa)
#### Post date: [June 7, 2020, 8:08am UTC](https://discuss.elastic.co/t/want-to-remove-filed-who-change-his-position-from-json-response/235794/4 "2020-06-07T08:08:10Z")

</div>

here is the solution

ruby {  
code =\> '  
volumesArray = event.get("data")  
if volumesArray  
newVolumesArray = []  
volumesArray.each { |x|  
x.delete("ssl")  
newVolumesArray \<\< x  
}  
event.set("data", newVolumesArray)  
end  
'  
}

---

<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: [July 5, 2020, 8:08am UTC](https://discuss.elastic.co/t/want-to-remove-filed-who-change-his-position-from-json-response/235794/5 "2020-07-05T08:08:21Z")

</div>

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