我正在尝试使用Bindplane将Java开发人员创建的“ syslog”上传到Google的Stackdriver。 Bindplane是基于流畅设计而成的。
我使用的是尾巴的来源类型。 Bindplane能够读取日志文件并将其推送到Stackdriver,但是它始终在JSON消息的正文中附加以下错误:
error: "invalid time format: value = 2019-10-21 16:52:29.588 EDT, error_class = ArgumentError, error = invalid strptime format - `%Y-%m-%d %H:%M:%S.%L%z'"
日志显示的格式与大多数syslog格式略有不同:
2019-10-21 13:15:02.439 EDT main TRACE Processor.init()
这是我流畅的配置中的内容:
<source>
@type tail
path C:/Test/Connect_Test/Log/**TestDL**.txt
pos_file C:/BlueMedora/BindplaneLogAgent/config/449c6ffb-1a29-4172-9058-e19de236d712.tail.log.pos
tag 449c6ffb-1a29-4172-9058-e19de236d712.1st_auto_policy
format syslog
time_format %Y-%m-%d %H:%M:%S.%L%z
</source>
有没有一种方法可以避免此错误而不更改日志?由于类/方法属于另一个开发人员,因此我无法更改日志的编写方式。
感谢您的帮助!
答案 0 :(得分:1)
Eddie-
我为Blue Medora工作,BindPlane是我们的产品。这样可以解决您的问题,如果不能解决,请告诉我们,我们可以帮助您正确配置它。
尝试time_format %Y-%m-%d %H:%M:%S.%L %Z
这是指向documentation on the strptime() options的链接,其中显示了%z和%Z之间的差异
再次,如果这对您不起作用,请告诉我们。