In my FluentBit config I have the following output:
<code> [Output]
name loki
match *
host loki
port 3100
labels container_name=$container_name $log_type
line_format json
</code>
<code> [Output]
name loki
match *
host loki
port 3100
labels container_name=$container_name $log_type
line_format json
</code>
[Output]
name loki
match *
host loki
port 3100
labels container_name=$container_name $log_type
line_format json
And it works fine, I can see in Loki corresponding labels existing, but they have white space between container name and log type. I’d like to get rid of it, but no matter what I tried – I couldn’t concatenate two variables, I tried the following:
- ${container_name}_${log_type}
- “${container_name}_${log_type}”
- ${container_name}${log_type}
But in best case I see result label as if variables are empty (but they’re not).
In worst case fluentBit crashes due to config parsing error.
Is it possible to join two variables/keys in ‘labels’ field of Output section?