How to handle a field in logstash filter whose type is not fixed

I would modify the field so that it is always an object. Something like this.