Skip to content

is /var/log/pods supported for kubernetes filter #4365

Answered by xavierivadulla
jvrahav asked this question in Q&A
Discussion options

You must be logged in to vote

To use /var/log/pods I generated my own parser.

Basically on INPUT I added the new log path, on PARSER I declared the new parser and on FILTER I use the new filter.

[INPUT]
    Name tail
    Tag kube.*
    multiline.parser cri, docker
    Path /var/log/pods/*/*/*log

[PARSER]
    Name    kube-pod-log
    Format  regex
    Reserve_Data true
    Regex   (?<namespace_name>[a-z0-9](?:[-a-z0-9]*[a-z0-9])?(?:_[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?<pod_name>[^_]+)_(?<docker_id>.*)\.(?<container_name>.*)\..*\.log$

[FILTER]
    Name kubernetes
    Match kube.*
 
    Kube_Tag_Prefix kube.var.log.pods.
    Regex_Parser kube-pod-log

Hope this can help.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jvrahav
Comment options

Answer selected by jvrahav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants