udp source

Ingests data through the UDP protocol and outputs `log` events.

The udp source ingests data through the UDP protocol and outputs log events.

Config File

vector.toml (simple)
vector.toml (advanced)
[sources.my_source_id]
type = "udp" # must be: "udp"
address = "0.0.0.0:9000"
# For a complete list of options see the "advanced" tab above.
[sources.udp_source]
#
# General
#
# The component type
#
# * required
# * no default
# * must be: "udp"
type = "udp"
# The address to bind the socket to.
#
# * required
# * no default
address = "0.0.0.0:9000"
# The maximum bytes size of incoming messages before they are discarded.
#
# * optional
# * default: 102400
# * unit: bytes
max_length = 102400
#
# Context
#
# The key name added to each event representing the current host.
#
# * optional
# * default: "host"
host_key = "host"

Examples

Given the following input line:

stdin
2019-02-13T19:48:34+00:00 [info] Started GET "/" for 127.0.0.1

A log event will be emitted with the following structure:

log
{
"timestamp": <timestamp> # current time,
"message": "2019-02-13T19:48:34+00:00 [info] Started GET "/" for 127.0.0.1",
"host": "10.2.22.122" # current nostname
}

How It Works

Context

By default, the udp source will add context keys to your events via the host_key options.

Delivery Guarantee

Due to the nature of this component, it offers a best effort delivery guarantee.

Environment Variables

Environment variables are supported through all of Vector's configuration. Simply add ${MY_ENV_VAR} in your Vector configuration file and the variable will be replaced before being evaluated.

You can learn more in the Environment Variables section.

Line Delimiters

Each line is read until a new line delimiter (the 0xA byte) is found.

Troubleshooting

The best place to start with troubleshooting is to check the Vector logs. This is typically located at /var/log/vector.log, then proceed to follow the Troubleshooting Guide.

If the Troubleshooting Guide does not resolve your issue, please:

  1. Check for any open udp_source issues.

  2. If encountered a bug, please file a bug report.

  3. If encountered a missing feature, please file a feature request.

  4. If you need help, join our chat/forum community. You can post a question and search previous questions.

Resources