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

mutiline logs ouput unexpected format on k8s #2013

Closed
yuzeshan opened this issue Mar 8, 2020 · 4 comments
Closed

mutiline logs ouput unexpected format on k8s #2013

yuzeshan opened this issue Mar 8, 2020 · 4 comments

Comments

@yuzeshan
Copy link

yuzeshan commented Mar 8, 2020

I configure multiline parser on k8s to collect multiple line logs, and that can collect them successfully, but output following format:
image

and expected behavior should make all line logs to merge into one

and my fluent bit(1.3.2) configure:

---
# Source: fluent-bit/templates/config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: release-name-fluent-bit-config
  namespace: logging
  labels:
    app: fluent-bit
    chart: fluent-bit-2.7.0
    heritage: Tiller
    release: release-name
data:
  fluent-bit-service.conf: |
    [SERVICE]
        Flush        1
        Daemon       Off
        Log_Level    info
        Parsers_File parsers.conf
        Refresh_Interval 5
        HTTP_Server  On
        HTTP_Listen  0.0.0.0
        HTTP_Port    2020

  fluent-bit-input.conf: |
    [INPUT]
        Name             tail
        Path             /var/log/containers/*.log
        Tag              kube.*
        Refresh_Interval 5
        Mem_Buf_Limit    5MB
        Skip_Long_Lines  On
        DB               /tail-db/tail-containers-state.db
        DB.Sync          Normal
        Multiline         On
        Multiline_Flush   5
        Parser_Firstline first



  fluent-bit-filter.conf: |
    [FILTER]
        Name                kubernetes
        Match               kube.*
        Kube_Tag_Prefix     kube.var.log.containers.
        Kube_URL            https://kubernetes.default.svc:443
        Kube_CA_File        /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        Kube_Token_File     /var/run/secrets/kubernetes.io/serviceaccount/token
        Labels              Off
        Annotations         Off
        K8S-Logging.Parser  On
        K8S-Logging.Exclude On


  fluent-bit-output.conf: |

    [OUTPUT]
        Name  es
        Match *
        Host  elastic
        Port  9200
        Logstash_Format On
        Retry_Limit 2
        Type  _doc
        Time_Key fluent_bit_output_ts
        Replace_Dots On
        Logstash_Prefix vpc_log




  fluent-bit.conf: |
    @INCLUDE fluent-bit-service.conf
    @INCLUDE fluent-bit-input.conf
    @INCLUDE fluent-bit-filter.conf
    @INCLUDE fluent-bit-output.conf


  parsers.conf: |
    [PARSER]
        Name first
        Format      regex
        Regex       (?<log>.*\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}.*)$
    [PARSER]
        Name        docker
        Format      json
        Time_Key    time
        Time_Format %Y-%m-%dT%H:%M:%S.%L
        Time_Keep   On
@yuzeshan
Copy link
Author

resolved

@AkshayDubey29
Copy link
Contributor

@yuzeshan Can you share your config, I am also facing the same issue?

@salla2
Copy link

salla2 commented Apr 4, 2020

@AkshayDubey29 / @yuzeshan can you share the config please, having the same issue. Thanks!

@avinashashukla
Copy link

I was able to resolve Java stack trace in Docker -> kubertees -> fluent-bit -> ES -> Kibana setup.
Refer #1400 (comment) for details.

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

4 participants