Convert device logs to MQTT topic/messages and publish to an MQTT broker


I would like to share a tool that I wrote to solve a specific problem, but in an abstract way that could potentially solve many problems for many people.

Abstract solution

I had been researching how to capture motion events from Unifi Video (a home surveillance software system). However Unifi Video does not support MQTT. Inspired by mzac’s unifi-video-mqtt script I wrote a more abstract solution called logs-to-mqtt-publisher that monitors a log file, matches on regular expressions, and publishes a topic/message to an MQTT broker.

(new users can only put 2 links in a post, so I’m making this more than 1 post.

Docker (but maybe others)

I imagine that those of us that are running in docker could more easily benefit from this solution. However I would like feedback from others who have logs that they would like to convert to MQTT events that cannot make use of docker. There may be a way to still use this tool.


Here is a Unifi Video specific example, if you go through the README it explains how to test this, if you’d like to experiment.

Published packages

I am publishing this to docker hub and npm.
Docker Hub

Latest documentation

See the README in the github repository for the latest documentation.

Additional background

I’m a software engineer by trade and lately I’ve been playing around in the open-source space. Something about solving a specific problem I have and allowing others to use the solution and potentially contribute seems like the superior approach, so I’ve been publishing as much of the code I write as possible.

Please let me know if you can make use of this and how I can help!