|
| 1 | +// Module included in the following assemblies: |
| 2 | +// cluster-logging-external.adoc |
| 3 | +// |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="logging-forward-splunk_{context}"] |
| 7 | += Forwarding logs to Splunk |
| 8 | + |
| 9 | +You can forward logs to the link:https://docs.splunk.com/Documentation/Splunk/9.0.0/Data/UsetheHTTPEventCollector[Splunk HTTP Event Collector (HEC)] in addition to, or instead of, the internal default {product-title} log store. |
| 10 | + |
| 11 | +[NOTE] |
| 12 | +==== |
| 13 | +Using this feature with Fluentd is not supported. |
| 14 | +==== |
| 15 | + |
| 16 | +.Prerequisites |
| 17 | +* Red Hat OpenShift Logging Operator 5.6 and higher |
| 18 | +* ClusterLogging instance with vector specified as collector |
| 19 | +* Base64 encoded Splunk HEC token |
| 20 | +
|
| 21 | +.Procedure |
| 22 | + |
| 23 | +. Create a secret using your Base64 encoded Splunk HEC token. |
| 24 | ++ |
| 25 | +[source,terminal] |
| 26 | +---- |
| 27 | +$ oc -n openshift-logging create secret generic vector-splunk-secret --from-literal hecToken=<HEC_Token> |
| 28 | +---- |
| 29 | ++ |
| 30 | +. Create or edit the `ClusterLogForwarder` Custom Resource (CR) using the template below: |
| 31 | ++ |
| 32 | +[source,yaml] |
| 33 | +---- |
| 34 | + apiVersion: "logging.openshift.io/v1" |
| 35 | + kind: "ClusterLogForwarder" |
| 36 | + metadata: |
| 37 | + name: "instance" <1> |
| 38 | + namespace: "openshift-logging" <2> |
| 39 | + spec: |
| 40 | + outputs: |
| 41 | + - name: splunk-receiver <3> |
| 42 | + secret: |
| 43 | + name: vector-splunk-secret <4> |
| 44 | + type: splunk <5> |
| 45 | + url: <http://your.splunk.hec.url:8088> <6> |
| 46 | + pipelines: <7> |
| 47 | + - inputRefs: |
| 48 | + - application |
| 49 | + - infrastructure |
| 50 | + name: <8> |
| 51 | + outputRefs: |
| 52 | + - splunk-receiver <9> |
| 53 | +---- |
| 54 | +<1> The name of the ClusterLogForwarder CR must be `instance`. |
| 55 | +<2> The namespace for the ClusterLogForwarder CR must be `openshift-logging`. |
| 56 | +<3> Specify a name for the output. |
| 57 | +<4> Specify the name of the secret that contains your HEC token. |
| 58 | +<5> Specify the output type as `splunk`. |
| 59 | +<6> Specify the URL (including port) of your Splunk HEC. |
| 60 | +<7> Specify which log types to forward by using the pipeline: `application`, `infrastructure`, or `audit`. |
| 61 | +<8> Optional: Specify a name for the pipeline. |
| 62 | +<9> Specify the name of the output to use when forwarding logs with this pipeline. |
0 commit comments