How to save on a file the output of mosquitto_sub?

Instead of printing it, how to save on a file the output of mosquitto_sub ?

Hi,

You can try this:

mosquitto_sub -t “your/topic” -h broker.example.com > output.txt