Trying to delete a tag


I was looking for a way to delete a tag from docs in an index and I found the following two discussions on github

I tried the suggestion in the first discussion:

And then I tried the suggestion in the second discussion:

But when I tried the syntax mentioned in that thread:

POST logstash-*/_update_by_query
"query" : {
"match" : { "tags": "GREEN" }
"script":{"inline":"ctx._source.tags.remove(ctx._source.field.indexOf(params.value))","lang":"painless","params": {"tag":"NEWTAG"}

I got the following error:

"type": "script_exception:,
"reason":"runtime error",
"script_stack": [
"                                                        ^---- HERE"
"caused_by": {
"reason": null

I'm still looking, but I'm hoping someone has a suggestion about either my syntax for another method...

Or, I've also read that these errors can be caused by a single field NOT being an array, then the whole operation crashes. Is there a way to find that one (or few) fields?

(system) #2

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