需要修改log-pilot环境变量的两个参数
LOGGING_OUTPUT的值配置为kafka
若将日志采集到kafka,则需要新增KAFKA_BROKERS环境变量,值为kafka broker的值,以逗号分割
- env:
- name: LOGGING_OUTPUT
value: kafka
- name: KAFKA_BROKERS
value: "10.168.246.152:9092,10.168.285.162:9092"
新增环境变量:aliyun_logs_topicname topicname就是kafka内已创建的主题
值为日志的路径,支持通配符*
env:
- name: TZ
value: Asia/Shanghai
- name: aliyun_logs_xieyun1
value: "/usr/local/tomcat/logs/*.log"
参考:https://blog.csdn.net/ltliyue/article/details/105121849