Use a label to determine whether to forward logs or not with Fluentd daemonset in K8s

template:
metadata:
labels:
app: myapp
console_log_forward: noforward
<match kubernetes.**>
@type rewrite_tag_filter
<rule>
key $.kubernetes.labels.console_log_forward
pattern /^noforward$/
tag clear
</rule>
# If there's other rewrite rules, add them here
</match>
<match clear>
@type null
</match>

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store