-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClusterLogForwarder.yaml
More file actions
147 lines (133 loc) · 4.31 KB
/
Copy pathClusterLogForwarder.yaml
File metadata and controls
147 lines (133 loc) · 4.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# ClusterLogForwarder
# Routing: All→Splunk via Cribl (with debug/trace drop filter), Errors→Dynatrace
apiVersion: observability.openshift.io/v1
kind: ClusterLogForwarder
metadata:
name: instance
namespace: openshift-logging
spec:
serviceAccount:
name: cluster-logging-operator
outputs:
# Output 1: Splunk via Cribl HEC
# TODO: Update URL to actual Cribl HEC endpoint
- name: splunk-via-cribl
type: splunk
splunk:
url: "https://cribl-hec-endpoint.cmgmi.local:8088"
index: "openshift-prod"
secret:
name: splunk-hec-token
tls:
insecureSkipVerify: false
# Output 2: Splunk via Cribl — splunk-demo namespace (index: openshift_test)
# Pattern: Add a new output per namespace/team that needs a different Splunk index.
# Same HEC endpoint, different index.
- name: splunk-splunk-demo
type: splunk
splunk:
url: "https://cribl-hec-endpoint.cmgmi.local:8088"
index: "openshift_test"
secret:
name: splunk-hec-token
tls:
insecureSkipVerify: false
# --- To add another namespace with a different index, copy the block above ---
# - name: splunk-<namespace>
# type: splunk
# splunk:
# url: "https://cribl-hec-endpoint.cmgmi.local:8088"
# index: "<their-index>"
# secret:
# name: splunk-hec-token
# tls:
# insecureSkipVerify: false
# Output 3: Dynatrace (errors only)
# TODO: Update URL and token to actual Dynatrace environment
- name: dynatrace-errors
type: http
http:
url: "https://DYNATRACE_ENV.live.dynatrace.com/api/v2/logs/ingest"
method: POST
headers:
Authorization: "Api-Token DT_API_TOKEN"
Content-Type: "application/json; charset=utf-8"
inputs:
# Input: Application logs scoped to splunk-demo namespace
# Pattern: Add a new input per namespace that needs custom routing.
- name: app-splunk-demo
type: application
application:
namespaces:
- splunk-demo
# --- To add another namespace, copy the block above ---
# - name: app-<namespace>
# type: application
# application:
# namespaces:
# - <namespace>
filters:
# Filter: Drop debug/trace logs BEFORE Splunk — prevents daily limit hits
- name: drop-debug
type: drop
drop:
- test:
- field: .level
matches: "^(debug|trace|DEBUG|TRACE)$"
# Filter: Keep only logs containing the keyword "forward_message_to_splunk"
# Drops everything that does NOT match the keyword in .message
- name: keyword-forward-to-splunk
type: drop
drop:
- test:
- field: .message
notMatches: "forward_message_to_splunk"
# Filter: Keep only error-level logs for Dynatrace
- name: errors-only
type: drop
drop:
- test:
- field: .level
notMatches: "^(error|err|fatal|critical|panic)$"
- field: .message
notMatches: "(?i)(exception|error|fatal|panic|stack.?trace)"
pipelines:
# Pipeline 1: Application logs → Splunk (debug/trace dropped)
- name: app-to-splunk
inputRefs:
- application
outputRefs:
- splunk-via-cribl
filterRefs:
- drop-debug
# Pipeline 2: Infrastructure logs → Splunk (no filter)
- name: infra-to-splunk
inputRefs:
- infrastructure
outputRefs:
- splunk-via-cribl
# Pipeline 3: splunk-demo namespace → Splunk (keyword-filtered, index: openshift_test)
# Only logs matching "forward_message_to_splunk" from the splunk-demo namespace
- name: splunk-demo-keyword-to-splunk
inputRefs:
- app-splunk-demo
outputRefs:
- splunk-splunk-demo
filterRefs:
- keyword-forward-to-splunk
# --- To add another namespace pipeline, copy the block above ---
# - name: <namespace>-keyword-to-splunk
# inputRefs:
# - app-<namespace>
# outputRefs:
# - splunk-<namespace>
# filterRefs:
# - keyword-forward-to-splunk
# Pipeline 4: Error-level logs → Dynatrace (all namespaces)
- name: errors-to-dynatrace
inputRefs:
- application
outputRefs:
- dynatrace-errors
filterRefs:
- errors-only