Back to Vector

0.40 Upgrade Guide

website/content/en/highlights/2024-07-29-0-40-0-upgrade-guide.md

0.55.02.6 KB
Original Source

Vector's 0.40.0 release includes three breaking changes:

  1. GELF codec defaults to null-delimited messages for stream-based sources
  2. Reduce transforms now properly aggregate nested fields
  3. Vector no longer supports CentOS 7

We cover them below to help you upgrade quickly:

Upgrade guide

Breaking Change

GELF codec defaults to null-delimited messages for stream-based sources {#gelf}

The GELF codec with stream-based sources now uses null byte (\\0) by default as messages delimiter instead of newline (\\n) character. This better matches GELF server behavior.

Configuration changes

In order to maintain the previous behavior, you must set the framing.method option to the character_delimited method and the framing.character_delimited.delimiter option to \\n when using GELF codec with stream-based sources.

Example configuration change for socket source
Previous
yaml
sources:
  my_source_id:
    type: "socket"
    address: "0.0.0.0:9000"
    mode: "tcp"
    decoding:
      codec: "gelf"
Current
yaml
sources:
  my_source_id:
    type: "socket"
    address: "0.0.0.0:9000"
    mode: "tcp"
    decoding:
      codec: "gelf"
    framing:
      method: "character_delimited"
    character_delimited:
      delimiter: "\n"

Reduce transforms now properly aggregate nested fields {#reduce-aggregate}

Reduce transforms can now properly aggregate nested fields.

This is a breaking change because previously, merging object elements used the "discard" strategy. The new behavior is to use the default strategy based on the element type.

Example
Config
yaml
group_by: ["id"]
merge_strategies:
  id: "discard"
  "a.b[0]": "array"
Event 1
json
{
  "id": 777,
  "an_array": [
    {
      "inner": 1
    }
  ],
  "message": {
    "a": {
      "b": [1, 2],
      "num": 1
    }
  }
}
Event 2
json
{
  "id": 777,
  "an_array": [
    {
      "inner": 2
    }
  ],
  "message": {
    "a": {
      "b": [3, 4],
      "num": 2
    }
  }
}
Reduced Event

Old behavior:

json
{
  "id": 777,
  "an_array": [
    {
      "inner": 2
    }
  ],
  "message": {
    "a": {
      "b": [1, 2],
      "num": 1
    }
  }
}

New behavior:

json
{
  "id": 777,
  "an_array": [
    {
      "inner": 1
    }
  ],
  "message": {
    "a": {
      "b": [
        [1, 2],
        [3,4]
      ],
      "num": 3
    }
  }
}

Vector no longer supports CentOS 7 {#centos7}

With this release, Vector has dropped support for CentOS 7 because CentOS 7 became EOL on June 30th, 2024.