diff --git a/config/test/vector/vector.toml b/config/test/vector/vector.toml index c071bb8..6416dbd 100644 --- a/config/test/vector/vector.toml +++ b/config/test/vector/vector.toml @@ -1,28 +1,49 @@ +[api] +enabled = true +address = "0.0.0.0:8686" + [sources.docker] type = "docker_logs" include_containers = ["proxy-server-dev-service"] [transforms.parse] -type = "remap" inputs = ["docker"] -source = ". = parse_json!(.message)" +type = "remap" +source = ''' +. = parse_json!(.message) +''' + +# =============== +# 用户访问记录 +# =============== [transforms.destinations] -type = "filter" inputs = ["parse"] +type = "filter" condition = ".msg == \"用户访问记录\"" [sinks.file_out] -type = "file" inputs = ["destinations"] +type = "file" path = "/temp/vector/service-destinations/%Y-%m-%d.log" encoding.codec = "csv" encoding.csv.fields = ["time", "uid", "user", "proxy", "node", "proto", "dest", "domain"] +buffer.type = "disk" +buffer.max_size = 268435488 -[sinks.file_out.buffer] -type = "disk" -max_size = 268435488 +# =============== +# errors +# =============== -[api] -enabled = true -address = "0.0.0.0:8686" \ No newline at end of file +[transforms.errors] +inputs = ["parse"] +type = "filter" +condition = ".level == \"ERROR\"" + +[sinks.file_errors] +inputs = ["errors"] +type = "file" +path = "/temp/vector/service-errors/%Y-%m-%d.log" +encoding.codec = "json" +buffer.type = "disk" +buffer.max_size = 268435488 \ No newline at end of file