我正在用一个唯一的时间字段jsont_code将json结构的日志消息写到stdout。
我使用Fluent Bit和尾部输入插件收集日志消息,该插件使用解析器origin_timestamp
。解析器配置了docker
。
有关Time_Key time
的文档说:
If the log entry provides a field with a timestamp, this option specify the name of that field.
由于
Time_Key
!= time
,我本来以为Fluent Bit不会添加任何时间字段,但是最终以Elasticsearch结尾的日志消息具有以下时间字段:origin_timestamp
)origin_timestamp
origin_timestamp
time
(有时甚至多次)。 @timestamp
字段可能是我在Fluent Bit中使用的es输出插件添加的,但是到底是哪里的@timestamp
字段来自?
最佳答案
我在Fluent位问题跟踪器Duplicate @timestamp fields in elasticsearch output中遇到了以下问题,这听起来可能与您所讨论的问题有关。
我已经深深地链接到其中一位贡献者的特定评论,其中概述了两种可能的解决方案,具体取决于您是使用他们的Kubernetes Filter插件,还是直接将日志摄取到Elasticsearch中。
希望这可以帮助。
关于docker - 我的结构化日志消息中的时间字段来自哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57869404/