Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] bcs-logbeat-sidecar 支持 multiline 配置,日志采集生命周期优化 #962

Open
AlexAi27 opened this issue Aug 10, 2021 · 0 comments
Assignees
Labels
feature new feature

Comments

@AlexAi27
Copy link
Collaborator

日志配置生命周期优化

具体流程

image

  • 当容器触发 die, stop 事件时,保留日志采集配置,修改配置使采集器读到日志末尾后主动释放日志文件,避免占用fd导致cbs无法解挂,出现Pod无法退出的情况。同时,可以配置最大持续采集时间,当时间到但采集器仍未采集完日志,仍然主动释放日志文件。
  • 当容器触发 destroy 事件时,删除日志配置,保证日志采集器释放日志文件

CRD变化

spec:
 # in second,容器退出后持续采集时间,如果出现pod terminating因为日志采集卡住则需要配置
  exitedContainerLogCloseTimeout: 10
# multiline 采集配置,详见https://www.elastic.co/guide/en/beats/filebeat/current/multiline-examples.html
  multiline:
    type: pattern
    pattern: "^[\\{\\t][\\s\\S]*"
    match: before
    #negate: 
    #flushPattern:
    #maxLines:
    #timeout:
    #countLines:
    #skiplNewline:
# 容器内日志配置
  containerConfs:
  - multiline:
      type: pattern
      pattern: "^[\\{\\t][\\s\\S]*"
      match: before
@AlexAi27 AlexAi27 added the feature new feature label Aug 10, 2021
AlexAi27 added a commit to AlexAi27/bk-bcs that referenced this issue Aug 10, 2021
AlexAi27 added a commit to AlexAi27/bk-bcs that referenced this issue Aug 10, 2021
AlexAi27 added a commit to AlexAi27/bk-bcs that referenced this issue Aug 10, 2021
AlexAi27 added a commit to AlexAi27/bk-bcs that referenced this issue Aug 10, 2021
AlexAi27 added a commit to AlexAi27/bk-bcs that referenced this issue Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new feature
Projects
None yet
Development

No branches or pull requests

2 participants