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

log-pilot是否可以支持基于容器的env或者label自定义生成tags #274

Open
Colstuwjx opened this issue Feb 10, 2020 · 1 comment · May be fixed by #275
Open

log-pilot是否可以支持基于容器的env或者label自定义生成tags #274

Colstuwjx opened this issue Feb 10, 2020 · 1 comment · May be fixed by #275

Comments

@Colstuwjx
Copy link

如题,比如我想把pod分配得到的IP作为elk录入日志记录的一个tag,目前是很难做到的,因为一般是我在启动容器之后才能知道拿到了哪个IP,log-pilot目前这块我看到是写死了一部分 代码

能否支持像自定义配置那样,自定义把哪些env或者label作为采集到elk日志的tags的一部分?这样的话,比如pod ip我可以通过如下方式映射到env,然后再指定让log-pilot消费该env作为tag:

        - name: MY_POD_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP

谢谢!

@Colstuwjx
Copy link
Author

关于label部分,log-pilot其实已经支持了,见这部分代码,用户只需要设置开头为com.aliyun.access.的标签,这类标签就会被转换(点换成下划线)并作为container元数据的一部分,用来渲染tags。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant