loki
built-in output plugin allows you to send your log or events to a Loki service. It supports data enrichment with Kubernetes labels, custom label keys and Tenant ID within others.loki/api/v1/push
, but just the base hostname/URL.key=value
pairs. In addition to fixed parameters, it also allows to add custom record keys (similar to label_keys
property). More details in the Labels section.json
or key_value
. If set to json
, the log line sent to Loki will be the Fluent Bit record dumped as JSON. If set to key_value
, the log line will be each item in the record concatenated together (separated by a single space) in the format.X-Scope-OrgID
of HTTP header. It is useful to set Tenant ID dynamically.job
and the value of the record key called stream
, your labels
configuration properties might look as follows:job
has the value fluentbit
and the second label is configured to access the nested map called sub
targeting the value of the key stream
. Note that the second label name must starts with a $
, that means that's a Record Accessor pattern so it provide you the ability to retrieve values from nested maps by using the key names.label_keys
propertylabel_keys
allow to specify multiple record keys that needs to be placed as part of the outgoing Stream Labels, yes, this is a similar feature than the one explained above in the labels
property. Consider this as another way to set a record key in the Stream, but with the limitation that you cannot use a custom name for the key value.auto_kubernetes_labels
which will auto-populate the streams with the Pod labels for you. Consider the following configuration:out_loki.conf
: