This is currently not possible, but there is an [open issue](https://github.com/elastic/logstash/issues/8514) covering discussions around this type of functionality.

---