Sign inSign up

rainu/mqtt-logger

By rainu

Updated over 5 years ago

A simple MQTT client subscribes topics and logs the whole payload to stdout.

Image
0

256

rainu/mqtt-logger repository overview

mqtt-logger

A simple MQTT client written in go that subscribes to a configurable list of MQTT topics on the specified broker and logs the whole payload to stdout.

Get the Binary

You can build it on your own (you will need golang installed):

go build -a -installsuffix cgo ./cmd/mqtt-logger/

Or you can download the release binaries: here

Running

Configuration is taken from the environment or via arguments, for example:

export MQTT_BROKER_ADDRESS="tcp://localhost:1883"
export MQTT_USERNAME="foo"
export MQTT_PASSWORD="bar"

./mqtt-logger

or

./mqtt-logger --broker "tcp://localhost:1883" --user "foo" --password "bar"
Available Environment/Arguments
ArgumentEnvironmentDefaultDescription
--topicMQTT_TOPICS#List of the mqtt topics to subscribe to.
--blacklistMQTT_TOPIC_BLACKLISTList of regular expression.
--brokerMQTT_BROKER_ADDRESSThe mqtt broker address.
--userMQTT_USERNAMEThe mqtt username.
--passwordMQTT_PASSWORDThe mqtt password.
--timeoutMQTT_TIMEOUT1mThe timeout for the mqtt connection.
--ca-certMQTT_CA_CERTThe path of the CA-Cert file for secure mqtt connection.

Tag summary

Content type

Image

Digest

Size

5.5 MB

Last updated

over 5 years ago

docker pull rainu/mqtt-logger