原数据
2023-03-22 10:30:25.123 [ERROR] [User Management Module] [User Login] User login failed
input.mtail/mtail.toml配置
[[instances]]
rogs = "/data/test/logs" #Connection closed目录
logs = ["/data/test/logs/test1.logs", "/data/test/logs/test2.logs"] #指定mtail要读取的日志
#override_timezone = "Asia/Shanghai" #指定时区
emit_metric_timestamp = "true" #metrics是否带时间戳,注意,这里是"true"
采集规则/data/test/logs/test.mtail
gauge test_logs
/ERROR/ {
test_logs++
}