How to stop the log entry from being split into multiple fields #9082
-
I have two Kubernetes clusters where I have Fluent Bit and OpenSearch running. I am using Fluent Bit to collect container logs and publish them to OpenSearch. I have a container which logs the following entry
There was a difference in how this log entry was returned from OpenSearch. So I added a new Cluster 1
Cluster 2
As you can see, in Cluster 2, the log entry gets added to a data:
custom_parsers.conf: |
[PARSER]
Name docker_no_time
Format json
Time_Keep Off
Time_Key time
Time_Format %Y-%m-%dT%H:%M:%S.%L
fluent-bit.conf: |
[SERVICE]
Daemon Off
Flush 1
Log_Level info
Parsers_File /fluent-bit/etc/parsers.conf
Parsers_File /fluent-bit/etc/conf/custom_parsers.conf
HTTP_Server On
HTTP_Listen 0.0.0.0
HTTP_Port 2020
Health_Check On
[INPUT]
Name tail
Inotify_Watcher false
Path /var/log/containers/*.log
multiline.parser docker, cri
Refresh_Interval 5
Tag kube.*
Mem_Buf_Limit 256MB
Skip_Long_Lines On
[FILTER]
Name kubernetes
Buffer_Size 32MB
K8S-Logging.Parser On
K8S-Logging.Exclude On
Keep_Log Off
Match kube.*
Merge_Log On
tls.verify Off
Use_Kubelet true
[FILTER]
Name lua
Match kube.*
script /fluent-bit/scripts/droplogs.lua
call drop
[OUTPUT]
Name opensearch
Host opensearch
HTTP_Passwd ${OPENSEARCH_PASSWORD}
HTTP_User test
Logstash_Format On
Logstash_DateFormat %Y-%m-%d
Logstash_Prefix container-logs
Match *
Port 9200
Replace_Dots On
Suppress_Type_Name On
tls On
tls.verify Off
Trace_Error On droplogs.lua is a custom filter which I use to drop some logs. However it does not modify the log entry like I saw in the output |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
pls. share droplogs.lua |
Beta Was this translation helpful? Give feedback.
-
Merge_log attempts to parse the log message so I suspect this is what is doing it. See #10293 (reply in thread) as well. |
Beta Was this translation helpful? Give feedback.
Merge_log attempts to parse the log message so I suspect this is what is doing it.
See #10293 (reply in thread) as well.