1.15. 根据源过滤审计和基础架构日志输入
您可以使用 input 选择器定义 audit 和 infrastructure 源列表,以收集日志。
流程
添加配置,以在
ClusterLogForwarderCR 中定义audit和infrastructure源。以下示例演示了如何配置
ClusterLogForwarderCR 以定义audit和infrastructure源:ClusterLogForwarderCR 示例apiVersion: observability.openshift.io/v1 kind: ClusterLogForwarder # ... spec: serviceAccount: name: <service_account_name> inputs: - name: mylogs1 type: infrastructure infrastructure: sources:1 - node - name: mylogs2 type: audit audit: sources:2 - kubeAPI - openshiftAPI - ovn # ...运行以下命令来应用
ClusterLogForwarderCR:$ oc apply -f <filename>.yaml