@@ -686,7 +686,7 @@ Previous versions without the `index` spec, would have instead written to 'app-w
686
686
687
687
=== Forwarding to Red Hat Managed Elasticsearch
688
688
====
689
- .Complete spec including url, version and index values from labels
689
+ .Complete spec including url, version and separate index for each log type
690
690
[source, yaml]
691
691
----
692
692
apiVersion: observability.openshift.io/v1
@@ -697,12 +697,44 @@ spec:
697
697
serviceAccount:
698
698
name: logcollector # <1>
699
699
outputs:
700
- - name: es-output-by-label # <2>
700
+ - name: es-app-output # <2>
701
701
type: elasticsearch
702
702
elasticsearch:
703
703
url: https://elasticsearch:9200
704
704
version: 6
705
- index: '{.openshift.label.my_log_index||"app"}-write' # <3>
705
+ index: 'app-write' # <3>
706
+ tls:
707
+ ca:
708
+ key: ca-bundle.crt
709
+ secretName: collector
710
+ certificate:
711
+ key: tls.crt
712
+ secretName: collector
713
+ key:
714
+ key: tls.key
715
+ secretName: collector
716
+ - name: es-infra-output # <2>
717
+ type: elasticsearch
718
+ elasticsearch:
719
+ url: https://elasticsearch:9200
720
+ version: 6
721
+ index: 'infra-write' # <3>
722
+ tls:
723
+ ca:
724
+ key: ca-bundle.crt
725
+ secretName: collector
726
+ certificate:
727
+ key: tls.crt
728
+ secretName: collector
729
+ key:
730
+ key: tls.key
731
+ secretName: collector
732
+ - name: es-audit-output # <2>
733
+ type: elasticsearch
734
+ elasticsearch:
735
+ url: https://elasticsearch:9200
736
+ version: 6
737
+ index: 'audit-write' # <3>
706
738
tls:
707
739
ca:
708
740
key: ca-bundle.crt
@@ -713,45 +745,31 @@ spec:
713
745
key:
714
746
key: tls.key
715
747
secretName: collector
716
- filters:
717
- - name: my-parse
718
- type: parse
719
- - name: my-app-label # <4>
720
- type: openshiftLabels
721
- openshiftLabels:
722
- my-log-index: app
723
- - name: my-infra-label # <5>
724
- type: openshiftLabels
725
- openshiftLabels:
726
- my-log-index: infra
727
748
pipelines:
728
- - name: my-app # <6 >
749
+ - name: my-app # <4 >
729
750
inputRefs:
730
751
- application
731
- filterRefs:
732
- - my-parse
733
- - my-app-label
734
752
outputRefs:
735
- - es-output-by-label
736
- - name: my-infra # <7 >
753
+ - es-app-output
754
+ - name: my-infra # <5 >
737
755
inputRefs:
738
756
- infrastructure
739
- filterRefs:
740
- - my-parse
741
- - my-infra-label
742
757
outputRefs:
743
- - es-output-by-label
758
+ - es-infra-output
759
+ - name: my-audit # <6>
760
+ inputRefs:
761
+ - audit
762
+ outputRefs:
763
+ - es-audit-output
744
764
----
745
765
<1> service account `logcollector` must have the correct permissions (see Service Accounts above)
746
- <2> `es-output-by-label` is the output used in both pipelines
747
- <3> `index` is set to read the value from `.openshift.label.my-log-index` and prepend to the string "-write" or fallback to "app-write"
748
- <4> `my-app-label` filter is used to set the label "my-log-index=app" in the pipeline
749
- <5> `my-infra-label` filter is used to set the label "my-log-index=infra" in the pipeline
750
- <6> pipeline `my-app` includes application logs and labels them `app`
751
- <7> pipeline `my-infra` includes infrastructure logs and labels them `infra`
766
+ <2> `es-app-output`, `es-infra-output` and `es-audit-output` are the outputs used in pipelines for route logs by log type
767
+ <3> `index` must follow naming scheme `app-*`, `infra-*` or `audit-*`
768
+ <4> pipeline `my-app` includes application logs and route them to the `es-app-output`
769
+ <5> pipeline `my-infra` includes infrastructure logs and route them to the `es-infra-output`
770
+ <6> pipeline `my-audit` includes audit logs and route them to the `es-audit-output`
752
771
753
772
NOTE: In order to forward logs to the default RH-managed Elasticsearch, the `index` values must be one of `app-write`, `infra-write` or `audit-write`.
754
- This is achieved by adding a label (filter) to each pipeline, and setting the label value to the corresponding input type.
755
773
====
756
774
757
775
=== Additional info on ES Custom Index
0 commit comments