2016-05-31 23:41:27 +08:00
|
|
|
# Graylog Output Plugin
|
|
|
|
|
|
2020-01-22 02:49:01 +08:00
|
|
|
This plugin writes to a Graylog instance using the "[GELF][]" format.
|
2016-05-31 23:41:27 +08:00
|
|
|
|
2020-01-22 02:49:01 +08:00
|
|
|
[GELF]: https://docs.graylog.org/en/3.1/pages/gelf.html#gelf-payload-specification
|
2022-03-01 00:20:08 +08:00
|
|
|
|
|
|
|
|
## GELF Fields
|
|
|
|
|
|
|
|
|
|
The [GELF spec][] spec defines a number of specific fields in a GELF payload.
|
|
|
|
|
These fields may have specific requirements set by the spec and users of the
|
|
|
|
|
Graylog plugin need to follow these requirements or metrics may be rejected
|
|
|
|
|
due to invalid data.
|
|
|
|
|
|
|
|
|
|
For example, the timestamp field defined in the GELF spec, is required to be
|
|
|
|
|
a UNIX timestamp. This output plugin will not modify or check the timestamp
|
|
|
|
|
field if one is present and send it as-is to Graylog. If the field is absent
|
|
|
|
|
then Telegraf will set the timestamp to the current time.
|
|
|
|
|
|
|
|
|
|
Any field not defined by the spec will have an underscore (e.g. `_`) prefixed
|
|
|
|
|
to the field name.
|
|
|
|
|
|
|
|
|
|
[GELF spec]: https://docs.graylog.org/docs/gelf#gelf-payload-specification
|
2016-05-31 23:42:07 +08:00
|
|
|
|
2021-11-25 02:47:33 +08:00
|
|
|
## Configuration
|
2016-05-31 23:42:07 +08:00
|
|
|
|
|
|
|
|
```toml
|
2022-04-08 05:55:03 +08:00
|
|
|
# Send telegraf metrics to graylog
|
2016-05-31 23:42:07 +08:00
|
|
|
[[outputs.graylog]]
|
2021-09-22 05:02:36 +08:00
|
|
|
## Endpoints for your graylog instances.
|
|
|
|
|
servers = ["udp://127.0.0.1:12201"]
|
|
|
|
|
|
|
|
|
|
## Connection timeout.
|
|
|
|
|
# timeout = "5s"
|
2020-01-22 02:49:01 +08:00
|
|
|
|
|
|
|
|
## The field to use as the GELF short_message, if unset the static string
|
|
|
|
|
## "telegraf" will be used.
|
|
|
|
|
## example: short_message_field = "message"
|
|
|
|
|
# short_message_field = ""
|
2021-10-21 22:39:24 +08:00
|
|
|
|
|
|
|
|
## According to GELF payload specification, additional fields names must be prefixed
|
|
|
|
|
## with an underscore. Previous versions did not prefix custom field 'name' with underscore.
|
|
|
|
|
## Set to true for backward compatibility.
|
|
|
|
|
# name_field_no_prefix = false
|
|
|
|
|
|
|
|
|
|
## Optional TLS Config
|
|
|
|
|
# tls_ca = "/etc/telegraf/ca.pem"
|
|
|
|
|
# tls_cert = "/etc/telegraf/cert.pem"
|
|
|
|
|
# tls_key = "/etc/telegraf/key.pem"
|
|
|
|
|
## Use TLS but skip chain & host verification
|
|
|
|
|
# insecure_skip_verify = false
|
2016-05-31 23:42:07 +08:00
|
|
|
```
|
2021-09-22 05:02:36 +08:00
|
|
|
|
|
|
|
|
Server endpoint may be specified without UDP or TCP scheme (eg. "127.0.0.1:12201").
|
2021-10-21 22:39:24 +08:00
|
|
|
In such case, UDP protocol is assumed. TLS config is ignored for UDP endpoints.
|