As we know we can deploy fluentd as DaemonSet in EKS
it can log all the stdout / stderr from the pod
however if a php application write a log into a file, the fluentd in DaemonSet will not catch the content of the file
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
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>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.