From 3d4bf3dd6cd289f2426956d34dcec3c8d7f2785e Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Mon, 15 Sep 2025 08:00:16 -0500 Subject: [PATCH] fluent-bit: Add hostname field to all records Messages from sources other than the systemd journal do not have a `hostname` field by default. This could make filtering logs difficult if there are multiple servers that host the same application. Thus, we need to inject the host name statically into every record, to ensure they can be correctly traced to their source machine. --- group_vars/all.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/group_vars/all.yml b/group_vars/all.yml index 2a6aa74..cc4e676 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -143,6 +143,10 @@ dnf_automatic_schedule: >- }} *-*-* 04:00:00 America/Chicago fluent_bit_default_filters: +- name: record_modifier + match: '*' + record: + - hostname ${HOSTNAME} # Avoid log amplification from logging the result of sending logs! - name: grep match: host.fluent-bit.service