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

为标准输出禁用 ansi 提供进程内的显式配置项 #66

Open
zhcsyncer opened this issue Aug 2, 2022 · 0 comments · May be fixed by #67
Open

为标准输出禁用 ansi 提供进程内的显式配置项 #66

zhcsyncer opened this issue Aug 2, 2022 · 0 comments · May be fixed by #67

Comments

@zhcsyncer
Copy link

容器运行时基于标准输出 -> log driver 的日志采集方式, 由于 ansi 的格式化, 导致采集日志的 agent 解析出现预期外的结果, 当前仅支持环境变量控制, 但 k8s 等环境的配置本身对于业务方来讲, 可控性不强.

且本场景理论上来说可能会因为不同的运行环境有差异, 比如本地开发环境依然是有意义的, 所以提供显式的配置项, 可针对不同的 profile 做相应的处理.

实际输出

^[[0m2022-08-01 21:57:13,543 INFO 75979 xxx^[[0m

基于 containerd + fluent-bit 的解析器

[PARSER]
    # http://rubular.com/r/tjUt3Awgg4
    Name cri
    Format regex
    Regex ^(?<time>[^ ]+) (?<stream>stdout|stderr) (?<logtag>[^ ]*) (?<message>(.|\n)*)$
    Skip_Empty_Values false
    Time_Key    time
    Time_Format %Y-%m-%dT%H:%M:%S.%L%z
zhcsyncer added a commit to zhcsyncer/logger that referenced this issue Aug 2, 2022
@zhcsyncer zhcsyncer linked a pull request Aug 2, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant