Q:有两个人掉到陷阱里了,死的人叫死人,活人叫什么?

pipeline定义字串转date问题

Elasticsearch | 作者 bzg119 | 发布于2019年09月03日 | 阅读数:1792

背景:
filebeat6.1.3
es 6.1.3
原始日志内容:
"2019-09-03 17:53:58,699 | INFO | This is the error content."

pipeline定义:
{
"description" : "log pipeline",
"processors": [
{
"grok": {
"field": "message",
"patterns": [
"%{TIMESTAMP_ISO8601:time}\\s*\\|\\s*%{DATA:level}\\s*\\|\\s*%{str:content}"
],
"pattern_definitions": {
"str": "[\\s\\S]*"
}
}
}, {
"date": {
"field": "time",
"target_field": "log_time",
"formats": ["TIMESTAMP_ISO8601"],
"ignore_failure": true
}
}
]
}

问题:
对message拆分是正常的,查询索引,有
"time": "2019-09-03 17:53:58,699"
这一串。然后将time转换成date就死活不成功。无法生成目标字段:log_time
把:
"ignore_failure": false
后,日志内容无法入ES库。说明ES在将字串转换成date时出的错。

"formats": ["TIMESTAMP_ISO8601"]
"formats": ["ISO8601"]
"formats": ["YYYY-MM-DD HH:MM:SS,milli"]
都尝试过了,都无法成功完成转换。
已邀请:

bzg119

赞同来自:

格式问题,改为:yyyy-MM-dd HH:mm:ss,SSS解决。

Florence - 待我光头之日

赞同来自:

额请问那这样格式化跟它原本的格式不是一样的么,原本日志是其他格式grok之后是否能,用date格式化成yyyy-MM-dd HH:mm:ss,SSS格式的

要回复问题请先登录注册