logdna-agent-v2
logdna-agent-v2 copied to clipboard
How to do ignore rules in kubernetes?
My cluster sending too much logs, Can I ignore\include patterns?
You can use the LOGDNA_EXCLUSION_RULES
or LOGDNA_INCLUSION_RULES
environment variables with a glob like pattern to include/exclude files and directories from monitoring. There's also a regex equivalent for these. More information can be found here
You are not overriding. Same for exclusion rules
extraEnv:
- name: LOGDNA_INCLUSION_RULES
value: /var/log/pods/dev-**
Still gives me - "*.log"
Because of INFO config: read the following options from cli, env and config:
log:
dirs:
- /var/log/
include:
glob:
- "*.log"
- /var/log/pods/dev-**
@jakedipity News?
@vorandrew
this log & journald options should work:
log:
dirs:
- /var/log/containers
include:
glob:
- "*/dev-*.log"
regex: []
exclude:
glob: []
regex: []
journald:
systemd_journal_tailer: false
Notes:
- log_dir is set to /var/log/containers
- journal log is disabled (another source of system logs)
- there are env vars for these params too
But unfortunately there is an issue with env vars. Need to use config file to override "log dirs" and put config somewhere on host and define LOGDNA_CONFIG_FILE.