fluent / fluent-bit

Fast and Lightweight Logs and Metrics processor for Linux, BSD, OSX and Windows
https://fluentbit.io
Apache License 2.0
5.88k stars 1.59k forks source link

Docker log concatenated #2784

Closed jacekmackiewicz closed 3 years ago

jacekmackiewicz commented 4 years ago

Bug Report

Describe the bug Docker log lines get concatenated, thus later when sending with http/gelf they some messages got ignored.

To Reproduce

Expected behavior Each line of log in separate message transmitted to http/gelf output. Noticed when using stdout format json that lines from docker get concatenated and when switching to http or gelf output only first log key gets sent, rest are ignored. Notice the second square bracket having two log keys.

2020-11-18T11: 09: 55.638890700Z [
    {
        "date": 1605697794.580902,
        "log": "[11:09:54 CALCULATIONWORK INF] OnMessageCalculationRequest.\r\n",
        "stream": "stdout",
        "time": "2020-11-18T11:09:54.5809018Z",
        "pod_name": "",
        "namespace_name": "development",
        "pod_id": "",
        "host": "windows",
        "container_name": "",
        "docker_id": "",
        "container_hash": "",
        "container_image": ""
    }
]
2020-11-18T11: 09: 56.625512600Z [
    {
        "date": 1605697794.639122,
        "log": "[11:09:54 CALCULATIONWORK INF] Received message: {}\r\n",
        "stream": "stdout",
        "time": "2020-11-18T11:09:54.6391224Z",
        "pod_name": "",
        "namespace_name": "development",
        "pod_id": "",
        "host": "windows",
        "container_name": "",
        "docker_id": "",
        "container_hash": "",
        "container_image": ""
    },
    {
        "date": 1605697795.932223,
        "log": "[11:09:55 CALCULATIONWORK WRN] Response from API, status code: NotFound\r\n",
        "stream": "stdout",
        "time": "2020-11-18T11:09:55.9322229Z",
        "pod_name": "",
        "namespace_name": "development",
        "pod_id": "",
        "host": "windows",
        "container_name": "",
        "docker_id": "",
        "container_hash": "",
        "container_image": ""
    }
]...

In graylog I end up seeing two messages instead of three or more.

Your Environment

apiVersion: apps/v1 kind: DaemonSet metadata: name: fluent-bit-windows namespace: logging labels: k8s-app: fluent-bit-logging version: v1 kubernetes.io/cluster-service: "true" annotations: fluentbit.io/exclude: "true" spec: selector: matchLabels: k8s-app: fluent-bit-logging version: v1 kubernetes.io/cluster-service: "true" template: metadata: labels: k8s-app: fluent-bit-logging version: v1 kubernetes.io/cluster-service: "true" annotations: fluentbit.io/exclude: "true" prometheus.io/scrape: "true" prometheus.io/port: "2020" prometheus.io/path: /api/v1/metrics/prometheus spec: containers:

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 3 years ago

This issue was closed because it has been stalled for 5 days with no activity.