From 3d0b27f2e7da3aa0b6aac4d468e52c918c955a37 Mon Sep 17 00:00:00 2001 From: luorijun Date: Mon, 3 Mar 2025 18:07:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=94=A8=E6=88=B7=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E8=AE=B0=E5=BD=95=E5=92=8C=E9=94=99=E8=AF=AF=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/test/vector/vector.toml | 41 +++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 10 deletions(-) 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