[GH-ISSUE #29] Possible to create a template that mixes json and text log output? #8

Open
opened 2026-03-03 00:06:05 +03:00 by kerem · 1 comment
Owner

Originally created by @iTerminate on GitHub (Nov 20, 2025).
Original GitHub issue: https://github.com/aurc/loggo/issues/29

Great utility! I use it to parse json output out of mosquitto_sub. The issue is I want to display the topic as well. Here is a sample output from mosuitto_sub:

app/add {"description":"Add action completed","entityName":"Item","entityId":252}

Is it possible to create a template that will extract the json and the topic that precedes the json message?

Originally created by @iTerminate on GitHub (Nov 20, 2025). Original GitHub issue: https://github.com/aurc/loggo/issues/29 Great utility! I use it to parse json output out of mosquitto_sub. The issue is I want to display the topic as well. Here is a sample output from `mosuitto_sub`: `app/add {"description":"Add action completed","entityName":"Item","entityId":252}` Is it possible to create a template that will extract the json and the topic that precedes the json message?
Author
Owner

@iTerminate commented on GitHub (Nov 20, 2025):

I found a solution using sed
mosquitto_sub -v -t "app/#" | sed -u 's/^\([^ ]*\) {\(.*\)}/{"topic":"\1",\2}/' | loggo stream

This converts the output to full json

<!-- gh-comment-id:3559534328 --> @iTerminate commented on GitHub (Nov 20, 2025): I found a solution using `sed` `mosquitto_sub -v -t "app/#" | sed -u 's/^\([^ ]*\) {\(.*\)}/{"topic":"\1",\2}/' | loggo stream` This converts the output to full json
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/loggo#8
No description provided.