Fluent

Collect logs from a Fluentd or Fluent Bit agent

status: beta role: sidecar role: aggregator delivery: best effort egress: stream state: stateless output: log

Configuration

Example configurations

{
  "sources": {
    "my_source_id": {
      "type": "fluent",
      "address": "0.0.0.0:24224"
    }
  }
}
[sources.my_source_id]
type = "fluent"
address = "0.0.0.0:24224"
---
sources:
  my_source_id:
    type: fluent
    address: 0.0.0.0:24224
{
  "sources": {
    "my_source_id": {
      "type": "fluent",
      "address": "0.0.0.0:24224",
      "receive_buffer_bytes": 65536
    }
  }
}
[sources.my_source_id]
type = "fluent"
address = "0.0.0.0:24224"
receive_buffer_bytes = 65_536
---
sources:
  my_source_id:
    type: fluent
    address: 0.0.0.0:24224
    receive_buffer_bytes: 65536
    keepalive: null
    tls: null

address

required string literal
The address to listen for TCP connections on.
Examples
"0.0.0.0:24224"

keepalive

optional object
Configures the TCP keepalive behavior for the connection to the source.

keepalive.time_secs

optional uint
The time a connection needs to be idle before sending TCP keepalive probes.

receive_buffer_bytes

optional uint
Configures the receive buffer size using the SO_RCVBUF option on the socket.
Examples
65536

tls

optional object
Configures the TLS options for incoming connections.

tls.ca_file

optional string literal
Absolute path to an additional CA certificate file, in DER or PEM format (X.509), or an in-line CA certificate in PEM format.

tls.crt_file

optional string literal
Absolute path to a certificate file used to identify this server, in DER or PEM format (X.509) or PKCS#12, or an in-line certificate in PEM format. If this is set, and is not a PKCS#12 archive, key_file must also be set. This is required if enabled is set to true.

tls.enabled

optional bool
Require TLS for incoming connections. If this is set, an identity certificate is also required.
default: false

tls.key_file

optional string literal
Absolute path to a private key file used to identify this server, in DER or PEM format (PKCS#8), or an in-line private key in PEM format.

tls.key_pass

optional string literal
Pass phrase used to unlock the encrypted key file. This has no effect unless key_file is set.

tls.verify_certificate

optional bool
If true, Vector will require a TLS certificate from the connecting host and terminate the connection if the certificate is not valid. If false (the default), Vector will not request a certificate from the client.
default: false

Output

Logs

Line

A Fluent message
Fields
* required string literal
In addition to the defined fields, all fields from the fluent message are inserted as root level fields.
Examples
hello world
host required string literal
The IP address the fluent message was sent from.
Examples
127.0.0.1
tag required string literal
The tag from the fluent message.
Examples
dummy.0
timestamp required timestamp
The timestamp extracted from the fluent message.
Examples
2020-10-10T17:07:36.452332Z

Telemetry

Metrics

link

component_received_events_total

counter
The number of events accepted by this component either from tagged origins like file and uri, or cumulatively from other origins.
component_id required
The Vector component ID.
component_kind required
The Vector component kind.
component_name required
Deprecated, use component_id instead. The value is the same as component_id.
component_scope required
The Vector component scope.
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.
host required
The hostname of the system Vector is running on.
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.
pid required
The process ID of the Vector instance.
pod_name optional
The name of the pod from which the event originates.
uri optional
The sanitized URI from which the event originates.

component_sent_event_bytes_total

counter
The total number of event bytes emitted by this component.
component_id required
The Vector component ID.
component_kind required
The Vector component kind.
component_name required
Deprecated, use component_id instead. The value is the same as component_id.
component_scope required
The Vector component scope.
component_type required
The Vector component type.
host required
The hostname of the system Vector is running on.
pid required
The process ID of the Vector instance.

component_sent_events_total

counter
The total number of events emitted by this component.
component_id required
The Vector component ID.
component_kind required
The Vector component kind.
component_name required
Deprecated, use component_id instead. The value is the same as component_id.
component_scope required
The Vector component scope.
component_type required
The Vector component type.
host required
The hostname of the system Vector is running on.
pid required
The process ID of the Vector instance.

decode_errors_total

counter
The total number of decode errors seen when decoding data in a source component.
component_id required
The Vector component ID.
component_kind required
The Vector component kind.
component_name required
Deprecated, use component_id instead. The value is the same as component_id.
component_scope required
The Vector component scope.
component_type required
The Vector component type.
host required
The hostname of the system Vector is running on.
pid required
The process ID of the Vector instance.

events_in_total

counter
The number of events accepted by this component either from tagged origins like file and uri, or cumulatively from other origins. This metric is deprecated and will be removed in a future version. Use component_received_events_total instead.
component_id required
The Vector component ID.
component_kind required
The Vector component kind.
component_name required
Deprecated, use component_id instead. The value is the same as component_id.
component_scope required
The Vector component scope.
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.
host required
The hostname of the system Vector is running on.
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.
pid required
The process ID of the Vector instance.
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. This metric is deprecated and will be removed in a future version. Use component_sent_events_total instead.
component_id required
The Vector component ID.
component_kind required
The Vector component kind.
component_name required
Deprecated, use component_id instead. The value is the same as component_id.
component_scope required
The Vector component scope.
component_type required
The Vector component type.
host required
The hostname of the system Vector is running on.
pid required
The process ID of the Vector instance.

processed_bytes_total

counter
The number of bytes processed by the component.
component_id required
The Vector component ID.
component_kind required
The Vector component kind.
component_name required
Deprecated, use component_id instead. The value is the same as component_id.
component_scope required
The Vector component scope.
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.
host required
The hostname of the system Vector is running on.
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.
pid required
The process ID of the Vector instance.
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 component_received_events_total and component_sent_events_total metrics.
component_id required
The Vector component ID.
component_kind required
The Vector component kind.
component_name required
Deprecated, use component_id instead. The value is the same as component_id.
component_scope required
The Vector component scope.
component_type required
The Vector component type.
host required
The hostname of the system Vector is running on.
pid required
The process ID of the Vector instance.

Examples

Dummy message from fluentd

Given this event...
2021-05-20 16:23:03.021497000 -0400 dummy: {"message":"dummy"}
...and this configuration...
[sources.my_source_id]
type = "fluent"
---
sources:
  my_source_id:
    type: fluent
{
  "sources": {
    "my_source_id": {
      "type": "fluent"
    }
  }
}
...this Vector event is produced:
{
 "log": {
  "host": "34.33.222.212",
  "message": "dummy",
  "tag": "dummy",
  "timestamp": "2021-05-20T20:23:03.021497Z"
 }
}

Dummy message from fluent-bit

Given this event...
dummy.0: [1621541848.161827000, {"message"=>"dummy"}]
...and this configuration...
[sources.my_source_id]
type = "fluent"
---
sources:
  my_source_id:
    type: fluent
{
  "sources": {
    "my_source_id": {
      "type": "fluent"
    }
  }
}
...this Vector event is produced:
{
 "log": {
  "host": "34.33.222.212",
  "message": "dummy",
  "tag": "dummy.0",
  "timestamp": "2020-05-20T20:17:28.161827Z"
 }
}

How it works

Acknowledgement support

The fluent source currently does not support the acknowledgement parts of the Fluent protocol and so the require_ack_response option forward output plugins for Fluent and Fluent Bit cannot be used.

If you would find this useful, please let us know.

Sending data from fluent agents to Vector aggregators

If you are already running fluent agents (Fluentd or Fluent Bit) in your infrastructure, this source can make it easy to start getting that data into Vector.

Context

By default, the fluent source augments events with helpful context keys.

Fluent Bit configuration

To configure Fluent Bit to forward to a Vector instance, you can use the following output configuration:

	[OUTPUT]
		Name          forward
		Match         *
		# update these to point to your vector instance
		Host          127.0.0.1
		Port          24224

Fluentd configuration

To configure Fluentd to forward to a Vector instance, you can use the following output configuration:

	<match *>
	  @type forward
	  <server>
		# update these to point to your vector instance
		name  local
		host  127.0.0.1
		port 24224
	  </server>
	  compress gzip
	</match>

Secure forward mode support

The fluent source currently supports using TLS, but does not support the authentication part of the Fluent protocol including:

  • Shared key
  • Username and password

And so these options of the secure forward output plugins for Fluent and Fluent Bit cannot be used.

If you would find this useful, please let us know.

State

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

Transport Layer Security (TLS)

Vector uses OpenSSL for TLS protocols. You can adjust TLS behavior via the tls.* options.