Route

Split a stream of events into multiple sub-streams based on user-supplied conditions

status: stable egress: stream state: stateless previously known as: swimlanes

Alias

This component was previously called the swimlanes transform. Make sure to update your Vector configuration to accommodate the name change:

[transforms.route]
+type = "route"
-type = "swimlanes"

Configuration

inputs

required [string]

A list of upstream source or transform IDs. Wildcards (*) are supported but must be the last character in the ID.

See configuration for more info.

Array string literal
Examples
[
  "my-source-or-transform-id",
  "prefix-*"
]

route

required object
A table of route identifiers to logical conditions representing the filter of the route. Each route can then be referenced as an input by other components with the name <transform_name>.<route_id>.

route.*

required string remap_boolean_expression
The condition to be matched against every input event. Only messages that pass the condition will be included in this route.

Telemetry

Metrics

link

events_discarded_total

counter
The total number of events discarded by this component.

events_in_total

counter
The number of events accepted by this component either from tagged origin like file and uri, or cumulatively from other origins.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.
container_name optional
The name of the container from which the event originates.
file optional
The file from which the event originates.
mode optional
The connection mode used by the component.
peer_addr optional
The IP from which the event originates.
peer_path optional
The pathname from which the event originates.
pod_name optional
The name of the pod from which the event originates.
uri optional
The sanitized URI from which the event originates.

events_out_total

counter
The total number of events emitted by this component.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.

processed_bytes_total

counter
The number of bytes processed by the component.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.
container_name optional
The name of the container from which the bytes originate.
file optional
The file from which the bytes originate.
mode optional
The connection mode used by the component.
peer_addr optional
The IP from which the bytes originate.
peer_path optional
The pathname from which the bytes originate.
pod_name optional
The name of the pod from which the bytes originate.
uri optional
The sanitized URI from which the bytes originate.

processed_events_total

counter
The total number of events processed by this component. This metric is deprecated in place of using events_in_total and events_out_total metrics.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.

Examples

Given this event...
{
  "log": {
    "level": "info"
  }
}
...and this Vector configuration...
[transforms.route]
type = "route"
route.debug = '.level == "debug"'
route.info = '.level == "info"'
route.warn = '.level == "warn"'
route.error = '.level == "error"'
...this Vector log event is produced:
{
  "level": "info"
}
Given this event...
{
  "metric": {
    "counter": {
      "value": 10000
    },
    "kind": "absolute",
    "name": "memory_available_bytes",
    "namespace": "host",
    "tags": {}
  }
}
...and this Vector configuration...
[transforms.route]
type = "route"
route.app = '.namespace == "app"'
route.host = '.namespace == "host"'
...this Vector metric event is produced:
{
  "counter": {
    "value": 10000
  },
  "kind": "absolute",
  "name": "memory_available_bytes",
  "namespace": "host",
  "tags": {}
}

How it works

State

This component is stateless, meaning its behavior is consistent across each input.