11.15. 将日志转发到 Splunk
除了内部的默认 OpenShift Container Platform 日志存储外,您还可以将日志转发到 Splunk HTTP 事件收集器 (HEC)。
注意
不支持在 Fluentd 中使用此功能。
先决条件
- Red Hat OpenShift Logging Operator 5.6 及更高版本
- 指定为 collector 的 ClusterLogging 实例
- Base64 编码的 Splunk HEC 令牌
流程
使用您的 Base64 编码的 Splunk HEC 令牌创建 secret。
$ oc -n openshift-logging create secret generic vector-splunk-secret --from-literal hecToken=<HEC_Token>使用以下模板创建或编辑
ClusterLogForwarder自定义资源 (CR):apiVersion: "logging.openshift.io/v1" kind: "ClusterLogForwarder" metadata: name: "instance"1 namespace: "openshift-logging"2 spec: outputs: - name: splunk-receiver3 secret: name: vector-splunk-secret4 type: splunk5 url: <http://your.splunk.hec.url:8088>6 pipelines:7 - inputRefs: - application - infrastructure name:8 outputRefs: - splunk-receiver9