How to do MQTT JSON from a library

Hi, I posted this first i in the Data Prepper that did not support it, so :
What is the best way to get json records from MQTT clients into an Index ?
I am running a Mosquitto MQTT server that I could subscribe to from some Opensearch tool that could put it into an index.
There is a mosquitto subscribe command that can return JSON lines on stdout, can that be input from somewhere in the Client libraries and put into and index?