Append values to array field

After I read this topic:

I modified the output config to become:
` output {
elasticsearch {
"hosts" => "http://myEShost:portnumber"
index => "my_index"
document_id => "%{a}"
action => "update"
script => 'if(ctx._source.b != null) ctx._source.b.add("%{b}");'

        }
        stdout {
            codec => json_lines
        }
    }`

but this is not doing the job it gives "version conflict, current version [77] is different than the one provided [76]"