简体   繁体   English

Kubernetes pod fluentd 转发到 fluentd DaemonSet

[英]Kubernetes pod fluentd forward to fluentd DaemonSet

As we know we can deploy fluentd as DaemonSet in EKS正如我们所知,我们可以在 EKS 中将 fluentd 部署为 DaemonSet

it can log all the stdout / stderr from the pod它可以记录 pod 中的所有 stdout / stderr

however if a php application write a log into a file, the fluentd in DaemonSet will not catch the content of the file但是,如果 php 应用程序将日志写入文件,则 DaemonSet 中的 fluentd 将无法捕获文件的内容

how do we make it happen?我们如何实现它?

im thinking put another fluentd container into the pod, and then tail the log file, and then forward it to other fluentd in DaemonSet我想把另一个 fluentd 容器放入 pod,然后跟踪日志文件,然后将其转发给 DaemonSet 中的其他 fluentd

eg例如

laravel.input.conf: |-
    <source>
      @type tail
      format multiline
      multiline_flush_interval 1s
      format_firstline /\[\d{4}-\d{1,2}-\d{1,2} \d{2}:\d{2}:\d{2}\]/
      format1 /^\[(?<time>[^\]]*)\] (?<environment>[^ ]*) (?<severity>[^ ]*): (?<message>.*)$/
      time_format %Y-%m-%d %H:%M:%S
      path /var/log/laravel.log
      pos_file /var/log/laravel.log.pos
      tag myapp.laravel
    </source>

is it possible可能吗

and how do make it happen?以及如何实现?

Why not just write out to stdout or error and using fluentd:为什么不直接写出标准输出或错误并使用流利的:

<source>
    @type tail
    @id in_tail_containers_logs
    path /var/log/containers/*.log
    ....
</source>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM