regex string which will capture a namespace and replace as required

8/18/2020

In my kubernetes cluster we have many namespace and we want to create a ES Index as per namespace, so currently we are adding namespace manually. like below team1(namespace) & team2(namespace) , So is it possible to use regex which can create a namespace index using regex input

input-kubernetes.conf: |
    [INPUT]
        Name              tail
        Tag               kube.team1.*  # namespace
        Path              /var/log/containers/*team1*.log  # namespace
        Parser            docker
        DB                /var/log/flb_kube_team1.db   # namespace
        Mem_Buf_Limit     5MB
        Skip_Long_Lines   Off
        Refresh_Interval  10
        
    [INPUT]
        Name              tail
        Tag               kube.team2.*   # namespace
        Path              /var/log/containers/*team2*.log  # namespace
        Parser            docker
        DB                /var/log/flb_kube_team2.db   # namespace
        Mem_Buf_Limit     5MB
        Skip_Long_Lines   Off
        Refresh_Interval  10
-- me2586
fluentd
kubernetes
regex

0 Answers