![](/img/trans.png)
[英]How to make mosquitto_sub print ONLY current message when subscribed to one topic
[英]How to make mosquitto_sub print topic and message when subscribed to #
以下命令顯示發布到與正則表達式匹配但不是確切主題本身的主題的所有消息。
mosquitto_sub -h localhost -u user -P pass -t 'devices/#'
{"value":"50"}
{"value":"45"}
例如,上面的json消息發布到主題設備/ 1234 / transducer / 46364 /但是我無法使用mosquitto_sub打印主題。
使用-v
選項
mosquitto_sub -h localhost -u user -P pass -v -t 'devices/#'
從手冊頁:
-v, --verbose
Print received messages verbosely. With this argument, messages
will be printed as "topic payload". When this argument is not
given, the messages are printed as "payload".
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.