Skip to content

Instantly share code, notes, and snippets.

@sorend
Created January 18, 2021 20:17
Show Gist options
  • Save sorend/52c510356fe3701a2c689ffb17f4bb29 to your computer and use it in GitHub Desktop.
Save sorend/52c510356fe3701a2c689ffb17f4bb29 to your computer and use it in GitHub Desktop.
<filter kubernetes.**>
@type record_transformer
@id id_kubernetes_metadata.fluentd.annotations
enable_ruby
<record>
fluentd_include ${record.dig("kubernetes", "annotations", "fluentd/include") ? record.dig("kubernetes", "annotations", "fluentd/include") : record.dig("kubernetes", "namespace_annotations", "fluentd/include") ? (record["kubernetes"]["namespace_annotations"]["fluentd/include"]) : ("false")}
fluentd_multiline ${record.dig("kubernetes", "annotations", "fluentd/multiline") ? record.dig("kubernetes", "annotations", "fluentd/multiline") : record.dig("kubernetes", "namespace_annotations", "fluentd/multiline") ? (record["kubernetes"]["namespace_annotations"]["fluentd/multiline"]) : ("false")}
</record>
</filter>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment