Back to Vector

New `encoding` and `framing` options for sinks

website/content/en/highlights/2022-07-07-sink-codecs.md

0.55.0989 B
Original Source

Sinks that allow codecs have been updated to allow analogous options to those that were previously added to sources. This means you can now, rather than just specifying encoding.codec, you can now supply custom framing options. Additionally, the supported codecs (encoding.codec) for each sink was expanded to be a uniform set of codecs.

For example, if you have a socket sink that you want to send length-delimited JSON-encoded, messages, you can now do so with configuration like:

yaml
sinks:
  socket:
    type: "socket"
    address: "92.12.333.224:5000"
    mode: "tcp"
    framing:
      method: "length_delimited"
    encoding:
      codec: "json"

This will encode messages flowing into this sink as JSON and frame them using length-delimited framing.