diff --git a/.changelog/3214.added.txt b/.changelog/3214.added.txt new file mode 100644 index 0000000000..8438d1c381 --- /dev/null +++ b/.changelog/3214.added.txt @@ -0,0 +1 @@ +feat(events): add sourceCategoryReplaceDash \ No newline at end of file diff --git a/deploy/helm/sumologic/README.md b/deploy/helm/sumologic/README.md index 646dee5321..1f5b1f579a 100644 --- a/deploy/helm/sumologic/README.md +++ b/deploy/helm/sumologic/README.md @@ -31,6 +31,7 @@ The following table lists the configurable parameters of the Sumo Logic chart an | `sumologic.events.provider` | Defines which provider is used for Kubernetes events collection - `otelcol` or `fluentd`. `otelcol` is the default and is recommended. `fluentd` is deprecated. | `otelcol` | | `sumologic.events.sourceName` | Source name for the Events source. | `events` | | `sumologic.events.sourceCategory` | Source category for the Events source. | `{clusterName}/events` | +| `sumologic.events.sourceCategoryReplaceDash` | Used to replace - with another character. | `"/"` | | `sumologic.events.persistence.enabled` | Enable persistence for the event collector. Persistence lets the collector avoid reingesting events on restart and buffer them locally if unable to reach the backend. | `true` | | `sumologic.events.persistence.persistentVolume.path` | Local filesystem path the persistent storage volume will be mounted at. | `/var/lib/storage/events` | | `sumologic.events.persistence.size` | Size of the persistent storage volume | `10Gi` | diff --git a/deploy/helm/sumologic/conf/events/otelcol/config.yaml b/deploy/helm/sumologic/conf/events/otelcol/config.yaml index 78c157ad87..966cae8589 100644 --- a/deploy/helm/sumologic/conf/events/otelcol/config.yaml +++ b/deploy/helm/sumologic/conf/events/otelcol/config.yaml @@ -36,6 +36,7 @@ processors: collector: {{ .Values.sumologic.collectorName | default .Values.sumologic.clusterName | quote }} source_category: {{ .Values.sumologic.events.sourceCategory | default (printf "%s/%s" (include "sumologic.clusterNameReplaceSpaceWithDash" .) (.Values.fluentd.events.sourceName )) | quote}} source_category_prefix: "" + source_category_replace_dash: {{ .Values.sumologic.events.sourceCategoryReplaceDash | quote}} source_name: {{ .Values.sumologic.events.sourceName | quote}} sumologic_schema: add_cloud_namespace: false diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index 2e031c2a2f..26777696d7 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -253,6 +253,9 @@ sumologic: ## Source category for the Events source. Default: "" which is resolved to "{clusterName}/events" # sourceCategory: "kubernetes/events" + ## Used to replace '-' with another character. + sourceCategoryReplaceDash: "/" + persistence: enabled: true size: 10Gi diff --git a/tests/helm/testdata/goldenfile/events_otc/basic.output.yaml b/tests/helm/testdata/goldenfile/events_otc/basic.output.yaml index db30bcc79d..f6bd9bec33 100644 --- a/tests/helm/testdata/goldenfile/events_otc/basic.output.yaml +++ b/tests/helm/testdata/goldenfile/events_otc/basic.output.yaml @@ -44,6 +44,7 @@ data: collector: kubernetes source_category: kubernetes/events source_category_prefix: "" + source_category_replace_dash: / source_name: events sumologic_schema: add_cloud_namespace: false diff --git a/tests/helm/testdata/goldenfile/events_otc/options.input.yaml b/tests/helm/testdata/goldenfile/events_otc/options.input.yaml index 898af51bb1..ae3663e407 100644 --- a/tests/helm/testdata/goldenfile/events_otc/options.input.yaml +++ b/tests/helm/testdata/goldenfile/events_otc/options.input.yaml @@ -8,5 +8,6 @@ sumologic: provider: otelcol sourceName: testSourceName sourceCategory: testSourceCategory + sourceCategoryReplaceDash: ";" persistence: enabled: false diff --git a/tests/helm/testdata/goldenfile/events_otc/options.output.yaml b/tests/helm/testdata/goldenfile/events_otc/options.output.yaml index ee4e55a27b..e1e17ac6bc 100644 --- a/tests/helm/testdata/goldenfile/events_otc/options.output.yaml +++ b/tests/helm/testdata/goldenfile/events_otc/options.output.yaml @@ -40,6 +40,7 @@ data: collector: testCollector source_category: testSourceCategory source_category_prefix: "" + source_category_replace_dash: ; source_name: testSourceName sumologic_schema: add_cloud_namespace: false