The following instructions assumes that you have a fully operational Graylog server running in your environment.
If you're using Fluent Bit to collect Docker logs, note that Docker places your log in JSON under key log
. So you can set log
as your Gelf_Short_Message_Key
to send everything in Docker logs to Graylog. In this case, you need your log
value to be a string; so don't parse it using JSON parser.
The order of looking up the timestamp in this plugin is as follows:
Value of Gelf_Timestamp_Key
provided in configuration
Value of timestamp
key
Timestamp does not set by Fluent Bit. In this case, your Graylog server will set it to the current timestamp (now).
The version
of GELF message is also mandatory and Fluent Bit sets it to 1.1 which is the current latest version of GELF.
If you use udp
as transport protocol and set Compress
to true
, Fluent Bit compresses your packets in GZIP format, which is the default compression that Graylog offers. This can be used to trade more CPU load for saving network bandwidth.
If you're using Fluent Bit for shipping Kubernetes logs, you can use something like this as your configuration file:
By default, GELF tcp uses port 12201 and Docker places your logs in /var/log/containers
directory. The logs are placed in value of the log
key. For example, this is a log saved by Docker:
Now, this is what happens to this log:
Fluent Bit GELF plugin adds "version": "1.1"
to it.
We used this data
key as Gelf_Short_Message_Key
; so GELF plugin changes it to short_message
.
Timestamp is generated.
Finally, this is what our Graylog server input sees: