Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rainu/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.
https://github.com/rainu/mqtt-logger
binary docker-image golang logging mqtt mqtt-logger
Last synced: about 4 hours ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/rainu/mqtt-logger
- Owner: rainu
- License: mit
- Created: 2021-01-16T14:03:37.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-01-16T18:32:05.000Z (almost 4 years ago)
- Last Synced: 2024-06-20T01:51:20.893Z (5 months ago)
- Topics: binary, docker-image, golang, logging, mqtt, mqtt-logger
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://golang.org/) installed):
```bash
go build -a -installsuffix cgo ./cmd/mqtt-logger/
```Or you can download the release binaries: [here](https://github.com/rainu/mqtt-logger/releases/latest)
## Running
Configuration is taken from the environment or via arguments, for example:
```bash
export MQTT_BROKER_ADDRESS="tcp://localhost:1883"
export MQTT_USERNAME="foo"
export MQTT_PASSWORD="bar"./mqtt-logger
```
or
```bash
./mqtt-logger --broker "tcp://localhost:1883" --user "foo" --password "bar"
```### Available Environment/Arguments
|Argument|Environment|Default|Description|
|--------|-----------|-------|-----------|
|--topic|MQTT_TOPICS| # |List of the mqtt topics to subscribe to.|
|--blacklist|MQTT_TOPIC_BLACKLIST| |List of regular expression.|
|--broker|MQTT_BROKER_ADDRESS| |The mqtt broker address.|
|--user|MQTT_USERNAME| |The mqtt username.|
|--password|MQTT_PASSWORD| |The mqtt password.|
|--timeout|MQTT_TIMEOUT| 1m |The timeout for the mqtt connection.|
|--ca-cert|MQTT_CA_CERT| |The path of the CA-Cert file for secure mqtt connection.|