Skip to main content

Pipe standard input to an MQTT server

Project description

log2mqtt

Simple Python program to publish standard input to an MQTT server on a desired topic.

Installation

The program can be installed using PIP.

pip install log2mqtt

Usage

Expected usage of the program is piping the standard output of a program you want to monitor the logs of into into the program. This looks something like:

my_program | python3 -m log2mqtt -s wss://mqtt.myserver.com:443 -u my_user -p my_pass -t /my_mqtt_topic

What Does It Do?

It publishes the standard output of the piped program to an MQTT server. Each break in the standard output is published as a new message and this program exits cleanly when the logged process terminates.

But Why?

I made a custom home assistant card which reads the sensor history of an MQTT sensor and renders it as a terminal, this allows me to monitor the logs of my scripts right in my home assistant instance without having to mess around with more complicated logging tools.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

log2mqtt-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

log2mqtt-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file log2mqtt-0.1.0.tar.gz.

File metadata

  • Download URL: log2mqtt-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.10.16 Linux/6.10.14-linuxkit

File hashes

Hashes for log2mqtt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fb53886f2c6beb7901c51eb9282e115752e7ff98360bbbca87d372d92c4620bc
MD5 f80bc4d40efb0f8598590a55806bb212
BLAKE2b-256 5eb4822306ee2ebe37ea6d4671a9619e8139ea617c9001f2775032268a6a6de2

See more details on using hashes here.

File details

Details for the file log2mqtt-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: log2mqtt-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.10.16 Linux/6.10.14-linuxkit

File hashes

Hashes for log2mqtt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9ee58494ef2db74e396f4d193a921e8fea25234c3eecd6e346e346deed6278c
MD5 2d7d08e931f56198a06c5871747b657d
BLAKE2b-256 78cb1966795a34b5ba4ac14dec7bc7d443efec916e8eb6f4fc38d8430b22c130

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page