This commit is contained in:
reonokiy 2025-05-15 01:46:38 +08:00
parent 1444ff5820
commit 11cf53c0bb
Signed by: reonokiy
SSH key fingerprint: SHA256:2VjKpUxMIe0QYY3OVnOMuPiB0X5pvrIpJ+UiyFhxtq0
2 changed files with 36 additions and 0 deletions

View file

@ -16,3 +16,18 @@ services:
ports: ports:
- 80:5080 - 80:5080
- 5081:5081 - 5081:5081
vector:
image: timberio/vector:${VECTOR_VERSION:-0.46.1-debian}
container_name: vector
restart: always
environment:
OPENOBSERVE_URL: ${OPENOBSERVE_URL}
OPENOBSERVE_USER: ${OPENOBSERVE_USER}
OPENOBSERVE_PASSWORD: ${OPENOBSERVE_PASSWORD}
volumes:
- ${DATA_DIR:-./data}/vector.toml:/etc/vector/vector.toml:ro
- ${DATA_DIR:-./data}/vector:/var/lib/vector:Z
- /var/run/docker.sock:/var/run/docker.sock

21
openobserve/vector.toml Normal file
View file

@ -0,0 +1,21 @@
data_dir = "/var/lib/vector"
[api]
enabled = false
[sources.observe-nokiy-net]
type = "docker_logs"
include_containers = ["openobserve"]
[sinks.openobserve]
inputs = ["observe-nokiy-net"]
type = "http"
uri = "${OPENOBSERVE_URL}"
method = "post"
auth.strategy = "basic"
auth.user = "${OPENOBSERVE_USER}"
auth.password = "${OPENOBSERVE_PASSWORD}"
compression = "gzip"
encoding.codec = "json"
encoding.timestamp_format = "rfc3339"
healthcheck.enabled = false