logdna-agent-v2 icon indicating copy to clipboard operation
logdna-agent-v2 copied to clipboard

How to do ignore rules in kubernetes?

Open vorandrew opened this issue 1 year ago • 4 comments

My cluster sending too much logs, Can I ignore\include patterns?

vorandrew avatar Apr 18 '23 17:04 vorandrew

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

jakedipity avatar Apr 18 '23 17:04 jakedipity

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-**

vorandrew avatar Apr 22 '23 11:04 vorandrew

@jakedipity News?

vorandrew avatar May 12 '23 12:05 vorandrew

@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:

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.

dkhokhlov avatar May 19 '23 00:05 dkhokhlov