Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tail path for /var/log/pods/POD_UID/CONTAINER_NAME/*.log throws invalid pattern #1535

Closed
y0zg opened this issue Aug 27, 2019 · 2 comments
Closed

Comments

@y0zg
Copy link

y0zg commented Aug 27, 2019

Bug Report

Describe the bug
I want to capture logs from path /var/log/pods///*.log but based on documentation it's not clear whether this is possible

To Reproduce

  1. helm fetch stable/fluent-bit --untar
  2. Modify values.yaml path
input:
  tail:
    memBufLimit: 5MB
    parser: docker
    path: /var/log/pods/*/*/*.log
  systemd:
    enabled: false
    filters:
      systemdUnit:
        - docker.service
        - kubelet.service
        - node-problem-detector.service
    maxEntries: 1000
    readFromTail: true
    tag: host.*

helm install --name fluentbit stable/fluent-bit -f fluent-bit/values.yaml --set backend.es.host=targer.server.path

ERROR:

[2019/08/27 10:28:41] [ warn] [filter_kube] invalid pattern for given tag kube.var.log.pods.ad7566ef-c35d-11e9-936a-ee2ce51991c9.couchdb.0.log

I can tail /var/log/pods/POD_UID/*/*.log with filebeat with below config but I don't find any reference for POD UID for fluentbit

  filebeat.yml: |
    filebeat.autodiscover:
      providers:
        - type: kubernetes
          include_pod_uid: true
          in_cluster: true
          hints.enabled: true
          include_annotations: '*'
          templates:
            - condition.regexp:
                kubernetes.container.name: '.+'
              config:
                - type: docker
                  combine_partial: true
                  cri.parse_flags: true
                  cri.force: true
                  containers:
                    path: "/var/log/pods/${data.kubernetes.pod.uid}/"
                    ids:
                      - "${data.kubernetes.container.name}"
@solsson
Copy link

solsson commented Aug 11, 2021

I find the /var/log/pods path working really well, with some benefits compared to /var/log/containers, using fluent.bit 1.8.3 in fluent/fluent-bit-kubernetes-logging#90. Significant commits are fluent/fluent-bit-kubernetes-logging@3dd95af and fluent/fluent-bit-kubernetes-logging@cbb9dae.

@y0zg y0zg closed this as completed Aug 12, 2021
@y0zg
Copy link
Author

y0zg commented Aug 12, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants