output stage

The output stage is an action stage that takes data from the extracted map andchanges the log line that will be sent to Loki.

Schema

  1. output:
  2. # Name from extracted data to use for the log entry.
  3. source: <string>

Example

For the given pipeline:

  1. - json:
  2. expressions:
  3. user: log
  4. message: stream
  5. - labels:
  6. user:
  7. - output:
  8. source: content

And the given log line:

  1. {"user": "alexis", "message": "hello, world!"}

Then the first stage will extract the following key-value pairs into theextracted map:

  • user: alexis
  • message: hello, world!

The second stage will then add user=alexis to the label set for the outgoinglog line, and the final output stage will change the log line from theoriginal JSON to hello, world!