Painless script error adding nested items

Hi,
Do you know how to invoke the same painless from logstash. Basically need help on how to pass parameters to painless in logstash.
There is another question stuck on the same issue - Update Nested object with logstash

Thanks