Skip to content

Commit d6f232d

Browse files
committed
Remove references to automatic source type detection and add examples of sourceType use to docs
1 parent e57b8ee commit d6f232d

6 files changed

Lines changed: 90 additions & 8 deletions

File tree

api/observability/v1/output_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ type Splunk struct {
13321332
Source string `json:"source,omitempty"`
13331333

13341334
// SourceType can be used to specify a pretrained or custom sourcetype in Splunk.
1335-
// If not specified, `sourceType` will be "_json" or be determined automatically when using `payloadKey` based on the type of the final event payload.
1335+
// If not specified, the Splunk source type used is `_json` but may be overridden when using `payloadKey`, depending on the structure of the final event payload.
13361336
// Details in: docs/features/logforwarding/outputs/splunk-forwarding.adoc
13371337
//
13381338
// Examples:

bundle/manifests/cluster-logging.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ spec:
19441944
- urn:alm:descriptor:com.tectonic.ui:text
19451945
- description: |-
19461946
SourceType can be used to specify a pretrained or custom sourcetype in Splunk.
1947-
If not specified, `sourceType` will be "_json" or be determined automatically when using `payloadKey` based on the type of the final event payload.
1947+
If not specified, the Splunk source type used is `_json` but may be overridden when using `payloadKey`, depending on the structure of the final event payload.
19481948
Details in: docs/features/logforwarding/outputs/splunk-forwarding.adoc
19491949
19501950
Examples:

bundle/manifests/observability.openshift.io_clusterlogforwarders.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3894,7 +3894,7 @@ spec:
38943894
sourceType:
38953895
description: |-
38963896
SourceType can be used to specify a pretrained or custom sourcetype in Splunk.
3897-
If not specified, `sourceType` will be "_json" or be determined automatically when using `payloadKey` based on the type of the final event payload.
3897+
If not specified, the Splunk source type used is `_json` but may be overridden when using `payloadKey`, depending on the structure of the final event payload.
38983898
Details in: docs/features/logforwarding/outputs/splunk-forwarding.adoc
38993899
39003900
Examples:

config/crd/bases/observability.openshift.io_clusterlogforwarders.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3894,7 +3894,7 @@ spec:
38943894
sourceType:
38953895
description: |-
38963896
SourceType can be used to specify a pretrained or custom sourcetype in Splunk.
3897-
If not specified, `sourceType` will be "_json" or be determined automatically when using `payloadKey` based on the type of the final event payload.
3897+
If not specified, the Splunk source type used is `_json` but may be overridden when using `payloadKey`, depending on the structure of the final event payload.
38983898
Details in: docs/features/logforwarding/outputs/splunk-forwarding.adoc
38993899
39003900
Examples:

config/manifests/bases/cluster-logging.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,7 @@ spec:
18671867
- urn:alm:descriptor:com.tectonic.ui:text
18681868
- description: |-
18691869
SourceType can be used to specify a pretrained or custom sourcetype in Splunk.
1870-
If not specified, `sourceType` will be "_json" or be determined automatically when using `payloadKey` based on the type of the final event payload.
1870+
If not specified, the Splunk source type used is `_json` but may be overridden when using `payloadKey`, depending on the structure of the final event payload.
18711871
Details in: docs/features/logforwarding/outputs/splunk-forwarding.adoc
18721872
18731873
Examples:

docs/features/logforwarding/outputs/splunk-forwarding.adoc

Lines changed: 85 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,90 @@ To ensure consistency and meaningful categorization, the `source` value can be d
6565
following Cluster Log Forwarder's conventions.
6666
6767
=== `sourceType`
68-
In Splunk, the `sourceType` field is used to format and categorise data. Splunk is bundled with many pretrained types and has the capability of defining custom types. Use this field to reference a source type defined in Splunk.
69-
If not specified, `sourceType` will be "_json" or be determined automatically when using `payloadKey` based on the type of the final event payload.
68+
In Splunk, the source type is used to define how incoming data should be parsed, interpreted, and categorised. Splunk includes many built-in source types and also allows for custom source types to be defined. The `sourceType` field should reference a source type configured in Splunk.
69+
70+
If not specified, the Splunk source type used is `_json` but may be overridden when using `payloadKey`, depending on the structure of the final event payload.
71+
72+
An example of a use case for this field is where a custom Splunk source type has been created to interpret particular log message content where key/value pairs are extracted and transformed into Splunk fields for use with dashboards.
73+
74+
Here is an example of a CLF where log events for an app are forwarded to a Splunk output sink with a user-defined source type :
75+
76+
```
77+
spec:
78+
inputs:
79+
- application:
80+
includes:
81+
- container: myapp
82+
namespace: my-app-*
83+
name: myapp
84+
type: application
85+
outputs:
86+
- name: splunk-myapp
87+
splunk:
88+
authentication:
89+
token:
90+
key: hecToken
91+
secretName: splunk-myapp
92+
sourceType: 'myapp:sourcetype'
93+
url: 'https://splunk.customer.com:8088'
94+
type: splunk
95+
pipelines:
96+
- name: myapp
97+
inputRefs:
98+
- myapp
99+
outputRefs:
100+
- splunk-myapp
101+
```
102+
103+
If a source type needs to be referenced for a particular application's log events, but is not appropriate for others, be sure to structure the ClusterLogFowarder so that it does not misrepresent the format of log events by using a single Splunk output sink.
104+
105+
Here is an example of a CLF where cluster-wide general app log events are forwarded to a Splunk output sink using the default source type of `_json`, and log events for an app are forwarded to a different Splunk output sink with a user-defined source type :
106+
107+
```
108+
spec:
109+
inputs:
110+
- name: application-general
111+
application:
112+
excludes:
113+
- container: myapp
114+
namespace: my-app-*
115+
type: application
116+
- name: application-myapp
117+
application:
118+
includes:
119+
- container: myapp
120+
namespace: my-app-*
121+
type: application
122+
outputs:
123+
- name: splunk-application-general
124+
splunk:
125+
authentication:
126+
token:
127+
key: hecToken
128+
secretName: splunk-application-general
129+
url: 'https://splunk.customer.com:8088'
130+
type: splunk
131+
- name: splunk-application-myapp
132+
splunk:
133+
authentication:
134+
token:
135+
key: hecToken
136+
secretName: splunk-application-myapp
137+
sourceType: 'myapp:sourcetype'
138+
url: 'https://splunk.customer.com:8088'
139+
type: splunk
140+
pipelines:
141+
- name: splunk-application-general
142+
inputRefs:
143+
- application-general
144+
outputRefs:
145+
- splunk-application-general
146+
- name: splunk-application-myapp
147+
inputRefs:
148+
- application-myapp
149+
outputRefs:
150+
- splunk-application-myapp
151+
```
70152
71153
=== `indexedFields`
72154
@@ -196,7 +278,7 @@ Below the table with default value depends on log_type and log_source will be us
196278
|`index`|||| not configured by default
197279
|`source`|SYSLOG_IDENTIFIER|ns_name_podName_containerName|.log_source|
198280
|`indexedFields`|||| not configured by default
199-
|`sourceType`|`_json` or `generic_single_line`|`_json` or `generic_single_line`|`_json` or `generic_single_line`| Can be explicitly defined, otherwise will be determined automatically based on the type of the final event payload
281+
|`sourceType`|`_json` or `generic_single_line`|`_json` or `generic_single_line`|`_json` or `generic_single_line`| Can be explicitly defined, otherwise will be determined based on the type of the final event payload
200282
|`host`|`.hostname`|`.hostname`|`.hostname`|not configurable
201283
|`payloadKey`|||| not configured by default
202284

0 commit comments

Comments
 (0)