lundi 23 février 2015

How to extract certain data from an MQTT stream


I type mosquitto_sub -d -t +/# from the ubuntu terminal to access the MQTT stream. However I would like to see only a specific set of data from the MQTT stream. I've added | grep -v PING so everything still be printed except for lines with PING in them but that didn't work :( I've tried | grep -A1 PUBLISH so I can see lines from the MQTT with PUBLISH in them, nothing changed. I just get the whole MQTT stream nothing gets filtered out.


Q: How can I see the certain thing that I want to see from an MQTT stream? Alternatively; How can I filter certain things out of the MQTT stream or how can I extract data from the MQTT stream?


UPDATE: my input from the ubuntu terminal is as follows $ mosquitto_sub -d -t +/# and I've tried $ mosquitto_sub -d -t +/# | grep -v PING and $ mosquitto_sub -d -t +/# | grep -A1 PUBLISH but it just streams everything, doesn't grep anything...



Aucun commentaire:

Enregistrer un commentaire