Ai
3 Star 7 Fork 0

Gitee 极速下载/git_cdn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://gitlab.com/grouperenault/git_cdn.git
克隆/下载
vector.toml.example 3.08 KB
一键复制 编辑 原始数据 按行查看 历史
Sebastien MICHEL 提交于 2024-11-27 23:57 +08:00 . feat: add docker-compose for vector
# [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"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mirrors/git_cdn.git
git@gitee.com:mirrors/git_cdn.git
mirrors
git_cdn
git_cdn
master

搜索帮助