A very simple service to pipe loki push API message to stdout as JSON object. The objective is to be able to multiplex logs send to loki to another service(s) such as kafka or elasticsearch using already-made utility such as fluent-bit or benthos. See example for reference on how to pipe received logs to fluent-bit.
Each entry received by loki-push-pipe will be converted to one json message with the following structure:
{
"labels": {
"<key1>":"<value1>",
"<key2>":"<value2>",
"...":"..."
},
"timestamp": "<rfc3999nano 2006-01-02T15:04:05.999999999Z07:00>",
"tenant_id": "<the tenant id>",
"line": "<the actual log>"
}
Each entry outputted will be separated by new line.