aws / eks-charts

Amazon EKS Helm chart repository
Apache License 2.0
1.21k stars 981 forks source link

Add ability to specify Tag_Regex #619

Open ypicard opened 3 years ago

ypicard commented 3 years ago

Is your feature request related to a problem? It would be nice to be able to specify a custom Tag_Regex for the tail input of the aws-for-fluent-bit helm chart.

Is your feature request related to a specific Helm chart, if yes mention name of the chart? This is for the aws-for-fluent-bit chart.

Describe the solution you'd like Add a variable to be able to specify the Tag_Regex param of the fluent-bit tail plugin: https://github.com/aws/eks-charts/blob/master/stable/aws-for-fluent-bit/templates/configmap.yaml

    [INPUT]
        Name              tail
        Tag               {{ .Values.input.tag }}
--->    Tag_Regex         {{ .Values.input.tagRegex }}
        Path              {{ .Values.input.path }}
        DB                {{ .Values.input.db }}
        Parser            {{ .Values.input.parser }}
        Docker_Mode       {{ .Values.input.dockerMode }}
        Mem_Buf_Limit     {{ .Values.input.memBufLimit }}
        Skip_Long_Lines   {{ .Values.input.skipLongLines }}
        Refresh_Interval  {{ .Values.input.refreshInterval }}
riccardolocci commented 1 year ago

Kinda necroposting here, but it can be done through the input.extraInputs param, like this:

input:
  enabled: true
  tag: kube.<namespace_name>.<workload_name>.<pod_name>.<container_name>
  path: "/var/log/containers/*.log"
  db: "/var/log/flb_kube.db"
  parser: docker
  dockerMode: "On"
  memBufLimit: 5MB
  skipLongLines: "On"
  refreshInterval: 10
  extraInputs: |
      Tag_Regex     (?<pod_name>[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?<namespace_name>[^_]+)_(?<workload_name>.+)-(?<container_name>.+).log