From acc041e1c3e923d7b670062ec54105a60d52975d Mon Sep 17 00:00:00 2001 From: bvn13 Date: Mon, 2 Sep 2024 23:06:39 +0300 Subject: [PATCH] logs collector updated --- vector.yaml | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/vector.yaml b/vector.yaml index d2ad9e0..12c0a71 100644 --- a/vector.yaml +++ b/vector.yaml @@ -20,9 +20,9 @@ transforms: source: >- l = . - log("!!! 1", level:"info", rate_limit_secs:0) + #log("!!! 1", level:"info", rate_limit_secs:0) - log(l, level:"info", rate_limit_secs:0) + #log(l, level:"info", rate_limit_secs:0) .app = {} @@ -44,7 +44,7 @@ transforms: .app.body = "" - log("!!! 2", level:"info") + #log("!!! 2", level:"info") m = if (exists(.message)) { to_string!(.message) @@ -55,7 +55,7 @@ transforms: msg, err = parse_json(m) if (err == null) { - log("!!! 2.1: {{m}}", level:"info", rate_limit_secs:0) + #log("!!! 2.1: {{m}}", level:"info", rate_limit_secs:0) .app.body = if (exists(msg.message)) { msg.message @@ -63,7 +63,7 @@ transforms: m } - log("!!! 2.1.1: {{m}}", level:"info", rate_limit_secs:0) + #log("!!! 2.1.1: {{m}}", level:"info", rate_limit_secs:0) trace = if (exists(msg.message)) { msgjson, e = parse_regex(msg.message, r'request_id=(?P\S+)') @@ -77,7 +77,7 @@ transforms: {} } - log("!!! 2.1.2: {{m}}", level:"info", rate_limit_secs:0) + #log("!!! 2.1.2: {{m}}", level:"info", rate_limit_secs:0) .app.trace_id = if (exists(trace.trace_id) && trace.trace_id != "") { trace.trace_id @@ -87,7 +87,7 @@ transforms: "" } - log("!!! 2.1.3: {{m}}", level:"info", rate_limit_secs:0) + #log("!!! 2.1.3: {{m}}", level:"info", rate_limit_secs:0) .app.trace_id = if (exists(.app.trace_id) && .app.trace_id != null && .app.trace_id != "") { span = parse_regex!(.app.trace_id, r'(?\w+)-(?\w+)-(?\w+)-(?\w+)-(?\w+)') @@ -107,7 +107,7 @@ transforms: "" } - log("!!! 2.1.4: {{m}}", level:"info", rate_limit_secs:0) + #log("!!! 2.1.4: {{m}}", level:"info", rate_limit_secs:0) .app.severity_text = if (exists(msg.level)) { s, e = to_string(msg.level) @@ -121,7 +121,7 @@ transforms: "INFO" } - log("!!! 2.1.5: {{m}}", level:"info", rate_limit_secs:0) + #log("!!! 2.1.5: {{m}}", level:"info", rate_limit_secs:0) .app.severity_number = if (exists(msg.level_value)) { i, e = to_int(msg.level_value) @@ -133,11 +133,11 @@ transforms: } } - log("!!! 2.1.6: {{m}}", level:"info", rate_limit_secs:0) + #log("!!! 2.1.6: {{m}}", level:"info", rate_limit_secs:0) .app.attributes.message = msg - log("!!! 2.1.7: {{m}}", level:"info", rate_limit_secs:0) + #log("!!! 2.1.7: {{m}}", level:"info", rate_limit_secs:0) .app.attributes.logger_name = if (exists(msg.logger_name)) { msg.logger_name @@ -145,7 +145,7 @@ transforms: "none" } - log("!!! 2.1.8: {{m}}", level:"info", rate_limit_secs:0) + #log("!!! 2.1.8: {{m}}", level:"info", rate_limit_secs:0) .app.attributes._timestamp = if (exists(msg.@timestamp)) { msg.@timestamp @@ -153,7 +153,7 @@ transforms: now() } - log("!!! 2.1.9: {{m}}", level:"info", rate_limit_secs:0) + #log("!!! 2.1.9: {{m}}", level:"info", rate_limit_secs:0) .app.attributes.thread_name = if (exists(msg.thread_name)) { msg.thread_name @@ -161,23 +161,22 @@ transforms: "none" } - log("!!! 2.1.10: {{m}}", level:"info", rate_limit_secs:0) + #log("!!! 2.1.10: {{m}}", level:"info", rate_limit_secs:0) .app.attributes.hostname = "$HOSTNAME" - log("!!! 2.1.11: {{m}}", level:"info", rate_limit_secs:0) + #log("!!! 2.1.11: {{m}}", level:"info", rate_limit_secs:0) .app.attributes.app_name = "${APP_NAME?Specify env.APP_NAME}" } else { - log("!!! 2.2: {{m}}", level:"warn", rate_limit_secs:0) + #log("!!! 2.2: {{m}}", level:"warn", rate_limit_secs:0) .app.body = m - log(err, level:"error", rate_limit_secs:0) + #log(err, level:"error", rate_limit_secs:0) } - log("!!! 3", level:"warn", rate_limit_secs:0) - + #log("!!! 3", level:"warn", rate_limit_secs:0) del(.message)