Metric to Log

Example Configuration

Metric To Log

Config
Input
Output
1[transforms.my_transform_id]
2type = "metric_to_log"
3host_tag = "host"
1{
2 "metric": {
3 "kind": "absolute",
4 "name": "histogram",
5 "timestamp": "2020-08-01T21:15:47+00:00",
6 "tags": {
7 "host": "my.host.com",
8 "code": "200"
9 },
10 "histogram": {
11 "buckets": [
12 {
13 "upper_limit": 1,
14 "count": 10
15 },
16 {
17 "upper_limit": 2,
18 "count": 20
19 }
20 ],
21 "count": 30,
22 "sum": 50
23 }
24 }
25}
1{
2 "log": {
3 "name": "histogram",
4 "timestamp": "2020-08-01T21:15:47+00:00",
5 "host": "my.host.com",
6 "tags": {
7 "code": "200"
8 },
9 "kind": "absolute",
10 "histogram": {
11 "buckets": [
12 {
13 "count": 10,
14 "upper_limit": 1
15 },
16 {
17 "count": 20,
18 "upper_limit": 2
19 }
20 ],
21 "count": 30,
22 "sum": 50
23 }
24 }
25}

Configuration Options

Required Options

inputs(required)

A list of upstream source or transform IDs. Wildcards (*) are supported.

See configuration for more info.

TypeSyntaxDefaultExample
arrayliteral["my-source-or-transform-id","prefix-*"]
type(required)

The component type. This is a required field for all components and tells Vector which component to use.

TypeSyntaxDefaultExample
stringliteral["metric_to_log"]

Advanced Options

host_tag(optional)

Tag key that identifies the source host.

TypeSyntaxDefaultExample
stringliteralhostname["host","hostname"]
timezone(optional)

The name of the time zone to apply to timestamp conversions that do not contain an explicit time zone. This overrides the global timezone option. The time zone name may be any name in the TZ database, or local to indicate system local time.

TypeSyntaxDefaultExample
stringliterallocal["local","America/NewYork","EST5EDT"]

How it Works

State

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