代码拉取完成,页面将自动刷新
# [keepalived]---[remap_keepalived]--\
# [haproxy]------[remap_haproxy]------\
# [gitcdn-udp]---[remap_gitcdn-udp]----\
# [gitcdn-log]---[remap_gitcdn-log]----->---[addserviceloc]--->[nstr_vector]
# [vector]-------[remap_vector]--------/
[sources.keepalived]
type = "file"
include = [ "/var/log/pods/default_keepalived*/**/*.log" ]
[sources.haproxy]
type = "file"
include = [ "/var/log/pods/default_haproxy*/**/*.log" ]
[sources.gitcdn-udp]
type = "socket"
address = "0.0.0.0:3465"
mode = "udp"
[sources.gitcdn-log]
type = "file"
include = [ "/var/log/pods/default_gitcdn*/**/*.log" ]
[sources.vector]
type = "internal_logs"
[transforms.remap_keepalived]
type = "remap"
inputs = ["keepalived"]
source = """
. |= parse_regex!(.message, r'^(?P<timestamp>\\d+-\\d+-\\d+T\\d+:\\d+:\\d+\\.\\d+Z) (?P<severity>\\w+) \\w+ \\w+ \\w+ \\d+ \\d+:\\d+:\\d+ \\d+: (?P<log>.*)$')
.application_name = "keepalived"
.timestamp = parse_timestamp(.timestamp, "%Y-%m-%dT%H:%M:%S.%zZ") ?? now()
"""
[transforms.remap_haproxy]
type = "remap"
inputs = ["haproxy"]
source = """
. |= parse_regex(.message, r'^(?P<timestamp>\\d+-\\d+-\\d+T\\d+:\\d+:\\d+.\\d+Z) \\w+ \\w+ (<\\d+>\\w+ \\d+ \\d+:\\d+:\\d+) (haproxy\\[\\d+\\]:) (?P<client_ip>(\\d+\\.){3}(\\d+)):(?P<client_port>\\d+) \\[(\\d+/\\w+/\\d+:\\d+:\\d+:\\d+\\.\\d+)\\] (?P<frontend_name>\\w+) (?P<backend_name>\\S+)/(?P<server_name>\\S+) (?P<TR>\\d+)/(?P<Tw>\\d+)/(?P<Tc>\\d+)/(?P<Tr>\\d+)/(?P<Ta>\\d+) (?P<status_code>\\d+) (?P<bytes_read>\\d+) (?P<captured_request_cookie>\\S+) (?P<captured_response_cookie>\\S+) (?P<termination_state>\\S+) (?P<actconn>\\d+)/(?P<feconn>\\d+)/(?P<beconn>\\d+)/(?P<srv_conn>\\d+)/(?P<retries>\\d+) (?P<srv_queue>\\d+)/(?P<backend_queue>\\d+) (?P<http_request>.*)$') ?? parse_regex!(.message, r'^(?P<timestamp>\\d+-\\d+-\\d+T\\d+:\\d+:\\d+.\\d+Z) (?P<log>.*)$')
.application_name = "haproxy"
.instance = "haproxy-gitcdn001.k8stage.renault.fr"
.timestamp = parse_timestamp(.timestamp, "%Y-%m-%dT%H:%M:%S.%zZ") ?? now()
"""
[transforms.remap_gitcdn-udp]
type = "remap"
inputs = ["gitcdn-udp"]
drop_on_error = true
source = """
. = parse_json!(.message)
.source_type = "udp"
"""
[transforms.remap_gitcdn-log]
type = "remap"
inputs = ["gitcdn-log"]
source = """
. |= parse_regex(.message, r'^(?P<timestamp>\\d+-\\d+-\\d+T\\d+:\\d+:\\d+\\.\\d+Z) \\w+ \\w+ (?P<log>.*)$') ?? parse_regex!(.message, r'^(?P<log>.*)$')
. |= parse_regex(.file, r'^/var/log/pods/default_\\S+/(?P<instance>\\S+)/\\S+.log$') ?? { "instance": "gitcdn" }
.application_name = "git-cdn"
.instance = join!([.instance, "-gitcdn001.k8stage.renault.fr"])
.timestamp = parse_timestamp(.timestamp, "%Y-%m-%dT%H:%M:%S.%zZ") ?? now()
"""
[transforms.remap_vector]
type = "remap"
inputs = ["vector"]
source = """
.application_name = "vector"
.instance = "local-vector"
"""
[transforms.addserviceloc]
type = "remap"
inputs = ["remap_keepalived", "remap_haproxy", "remap_gitcdn-udp", "remap_gitcdn-log", "remap_vector"]
# inputs = ["gitcdn-udp"]
source = """
.hostname = "local"
.location = "dev"
.@timestamp = del(.timestamp)
"""
[sinks.nstr_vector]
inputs = ["addserviceloc"]
type = "vector"
address = "<vector-server>:30478"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。