chore(vector): filter journald noise, add core-git, and remove vector from VPS playbooks
ansible-deploy / plan (push) Successful in 2s
ansible-lint / lint (push) Successful in 3s
ansible-deploy / deploy (core-mon, ) (push) Successful in 8s
ansible-deploy / deploy (core-net, ) (push) Successful in 9s
ansible-deploy / deploy (core-secrets, ) (push) Successful in 8s
ansible-deploy / deploy (ger-nod-02, ) (push) Successful in 1m13s
ansible-deploy / deploy (rus-central, ) (push) Successful in 1m2s
ansible-deploy / plan (push) Successful in 2s
ansible-lint / lint (push) Successful in 3s
ansible-deploy / deploy (core-mon, ) (push) Successful in 8s
ansible-deploy / deploy (core-net, ) (push) Successful in 9s
ansible-deploy / deploy (core-secrets, ) (push) Successful in 8s
ansible-deploy / deploy (ger-nod-02, ) (push) Successful in 1m13s
ansible-deploy / deploy (rus-central, ) (push) Successful in 1m2s
This commit is contained in:
1 parent
a5f3400c0c
commit
71f1a009bf
5 files changed
+30
-25
No files matched your search
@@ -8,3 +8,5 @@
|
|||||||
tags: [gitea]
|
tags: [gitea]
|
||||||
- role: core-git/cadvisor
|
- role: core-git/cadvisor
|
||||||
tags: [cadvisor]
|
tags: [cadvisor]
|
||||||
|
- role: vector
|
||||||
|
tags: [vector]
|
||||||
@@ -9,7 +9,3 @@
|
|||||||
tags: [remnanode]
|
tags: [remnanode]
|
||||||
- role: vmagent
|
- role: vmagent
|
||||||
tags: [vmagent]
|
tags: [vmagent]
|
||||||
- role: vector
|
|
||||||
vars:
|
|
||||||
vector_enabled: false
|
|
||||||
tags: [vector]
|
|
||||||
@@ -7,7 +7,3 @@
|
|||||||
tags: [netbird]
|
tags: [netbird]
|
||||||
- role: rus-central/cadvisor
|
- role: rus-central/cadvisor
|
||||||
tags: [cadvisor]
|
tags: [cadvisor]
|
||||||
- role: vector
|
|
||||||
vars:
|
|
||||||
vector_enabled: false
|
|
||||||
tags: [vector]
|
|
||||||
@@ -15,25 +15,23 @@
|
|||||||
state: absent
|
state: absent
|
||||||
when: vector_legacy_compose.stat.exists
|
when: vector_legacy_compose.stat.exists
|
||||||
|
|
||||||
- name: Отключить и удалить конфиг Vector, если сбор логов выключен
|
- name: Полностью удалить Vector, если сбор логов выключен
|
||||||
when: not (vector_enabled | bool)
|
when: not (vector_enabled | bool)
|
||||||
block:
|
block:
|
||||||
- name: Проверить наличие systemd-сервиса Vector
|
- name: Удалить пакет Vector (purge)
|
||||||
ansible.builtin.stat:
|
ansible.builtin.apt:
|
||||||
path: /lib/systemd/system/vector.service
|
|
||||||
register: vector_unit
|
|
||||||
|
|
||||||
- name: Остановить и отключить Vector
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
name: vector
|
name: vector
|
||||||
state: stopped
|
|
||||||
enabled: false
|
|
||||||
when: vector_unit.stat.exists
|
|
||||||
|
|
||||||
- name: Удалить конфигурацию Vector
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ vector_config_path }}"
|
|
||||||
state: absent
|
state: absent
|
||||||
|
purge: true
|
||||||
|
|
||||||
|
- name: Удалить каталоги и репозиторий Vector
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: absent
|
||||||
|
loop:
|
||||||
|
- /etc/vector
|
||||||
|
- "{{ vector_data_dir }}"
|
||||||
|
- /etc/apt/sources.list.d/vector.list
|
||||||
|
|
||||||
- name: Установить и запустить нативный Vector
|
- name: Установить и запустить нативный Vector
|
||||||
when: vector_enabled | bool
|
when: vector_enabled | bool
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ sources:
|
|||||||
type: docker_logs
|
type: docker_logs
|
||||||
exclude_containers:
|
exclude_containers:
|
||||||
- vector
|
- vector
|
||||||
|
- monitoring-vlogs
|
||||||
|
|
||||||
journald:
|
journald:
|
||||||
type: journald
|
type: journald
|
||||||
@@ -27,14 +28,26 @@ transforms:
|
|||||||
msg = replace(msg, r'(?i)((?:password|passwd|secret|api_?key|token)\s*[:=]\s*)[^\s,;"]+', "${1}[REDACTED]")
|
msg = replace(msg, r'(?i)((?:password|passwd|secret|api_?key|token)\s*[:=]\s*)[^\s,;"]+', "${1}[REDACTED]")
|
||||||
.message = msg
|
.message = msg
|
||||||
|
|
||||||
|
filter_journald:
|
||||||
|
type: filter
|
||||||
|
inputs:
|
||||||
|
- journald
|
||||||
|
condition: |
|
||||||
|
ident = to_string(.SYSLOG_IDENTIFIER) ?? ""
|
||||||
|
!starts_with(ident, "ansible-") && !includes(["vector", "(systemd)", "CRON"], ident)
|
||||||
|
|
||||||
normalize_journald:
|
normalize_journald:
|
||||||
type: remap
|
type: remap
|
||||||
inputs:
|
inputs:
|
||||||
- journald
|
- filter_journald
|
||||||
source: |
|
source: |
|
||||||
.host = "{{ vector_host_name }}"
|
.host = "{{ vector_host_name }}"
|
||||||
.source_type = "host"
|
.source_type = "host"
|
||||||
.service = to_string(.SYSLOG_IDENTIFIER) ?? to_string(._SYSTEMD_UNIT) ?? "kernel"
|
svc = to_string(.SYSLOG_IDENTIFIER) ?? to_string(._SYSTEMD_UNIT) ?? "kernel"
|
||||||
|
if svc == "sshd-session" {
|
||||||
|
svc = "sshd"
|
||||||
|
}
|
||||||
|
.service = svc
|
||||||
msg = to_string(.message) ?? ""
|
msg = to_string(.message) ?? ""
|
||||||
msg = replace(msg, r'(?i)(bearer\s+)[a-z0-9._-]+', "${1}[REDACTED]")
|
msg = replace(msg, r'(?i)(bearer\s+)[a-z0-9._-]+', "${1}[REDACTED]")
|
||||||
msg = replace(msg, r'(?i)((?:password|passwd|secret|api_?key|token)\s*[:=]\s*)[^\s,;"]+', "${1}[REDACTED]")
|
msg = replace(msg, r'(?i)((?:password|passwd|secret|api_?key|token)\s*[:=]\s*)[^\s,;"]+', "${1}[REDACTED]")
|
||||||
|
|||||||
Reference in new issue
Block a user