完善日志输出配置

This commit is contained in:
2025-03-05 10:20:02 +08:00
parent a1717ff0d1
commit ae7fcfe484
6 changed files with 54 additions and 20 deletions

View File

@@ -1,3 +1,5 @@
timezone = "Asia/Shanghai"
[api]
enabled = true
address = "0.0.0.0:8686"
@@ -11,6 +13,11 @@ inputs = ["docker"]
type = "remap"
source = '''
. = parse_json!(.message)
.time, err = format_timestamp(parse_timestamp!(.time, "%+"), "%Y-%m-%dT%H:%M:%S", "Asia/Shanghai")
if err != null {
log("Unable to parse JSON: " + err, level: "error")
abort
}
'''
# ===============