gliderlabs / gliderlabs/logspout
Syslog: containers informations
- Dominant language
- Go
- Stars
- 4.7k
- Forks
- 661
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I want to put my containers logs into my syslog server (running with syslog-ng).
So I'm trying Logspout, and the logs are well sent to my syslog server.
But there only the stout of all containers, mixed in one log file (somethink like `docker-host.hostname/2018/06/user.notice.20180605.log`). No container hostname or stack name (I'm using Rancher).
I would like to add some fields that are in my labels to the log line to identify what kind of logs I have and make data extraction.
Is it possible?
here is my actual config:
```
docker-compose.yml
version: '2'
services:
logspout:
image: gliderlabs/logspout:latest
environment:
LOGSPOUT: ignore
ROUTE_URIS: udp://mysyslogserver:514
SYSLOG_TAG: '{{ index .Container.Config.Labels "io.rancher.project_service.name"
}}[{{ index .Container.Config.Labels "io.rancher.stack_service.name" }}]'
SYSLOG_HOSTNAME: '{{ index .Container.Config.Labels "io.rancher.container.name"
}}'
stdin_open: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
tty: true
ports:
- 8086:80/tcp
labels:
io.rancher.scheduler.global: 'true'
io.rancher.container.hostname_override: container_name
```
But SYSLOG_TAG or SYSLOG_HOSTNAME don't change anything...
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by examining how the SYSLOG_TAG and SYSLOG_HOSTNAME settings are handled and how Docker container labels are exposed to them. Reproduce the provided docker-compose configuration, then verify that routed syslog messages include the requested container or stack identifying fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100