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

This commit is contained in:
karpenok committed 2026-11-18 12:40:26 +07:00
1 parent a5f3400c0c
commit 71f1a009bf
5 files changed
+30 -25

No files matched your search

+13 -15
View File
@@ -15,25 +15,23 @@
state: absent
when: vector_legacy_compose.stat.exists
- name: Отключить и удалить конфиг Vector, если сбор логов выключен
- name: Полностью удалить Vector, если сбор логов выключен
when: not (vector_enabled | bool)
block:
- name: Проверить наличие systemd-сервиса Vector
ansible.builtin.stat:
path: /lib/systemd/system/vector.service
register: vector_unit
- name: Остановить и отключить Vector
ansible.builtin.systemd:
- name: Удалить пакет Vector (purge)
ansible.builtin.apt:
name: vector
state: stopped
enabled: false
when: vector_unit.stat.exists
- name: Удалить конфигурацию Vector
ansible.builtin.file:
path: "{{ vector_config_path }}"
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
when: vector_enabled | bool
+15 -2
View File
@@ -5,6 +5,7 @@ sources:
type: docker_logs
exclude_containers:
- vector
- monitoring-vlogs
journald:
type: journald
@@ -27,14 +28,26 @@ transforms:
msg = replace(msg, r'(?i)((?:password|passwd|secret|api_?key|token)\s*[:=]\s*)[^\s,;"]+', "${1}[REDACTED]")
.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:
type: remap
inputs:
- journald
- filter_journald
source: |
.host = "{{ vector_host_name }}"
.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 = 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]")