Skip to content

Commit

Permalink
chore!: move parameters from fluentd.logs.default to sumologic.logs.d…
Browse files Browse the repository at this point in the history
…efaultFluentd

- move `fluentd.logs.default.sourceName` to `sumologic.logs.defaultFluentd.sourceName`
- move `fluentd.logs.default.sourceCategory` to `sumologic.logs.defaultFluentd.sourceCategory`
- move `fluentd.logs.default.sourceCategoryPrefix` to `sumologic.logs.defaultFluentd.sourceCategoryPrefix`
- move `fluentd.logs.default.sourceCategoryReplaceDash` to `sumologic.logs.defaultFluentd.sourceCategoryReplaceDash`
- move `fluentd.logs.default.excludeFacilityRegex` to `sumologic.logs.defaultFluentd.excludeFacilityRegex`
- move `fluentd.logs.default.excludeHostRegex` to `sumologic.logs.defaultFluentd.excludeHostRegex`
- move `fluentd.logs.default.excludePriorityRegex` to `sumologic.logs.defaultFluentd.excludePriorityRegex`
- move `fluentd.logs.default.excludeUnitRegex` to `sumologic.logs.defaultFluentd.excludeUnitRegex`
  • Loading branch information
kasia-kujawa committed Nov 25, 2022
1 parent b1fb3b3 commit a2e0daf
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 50 deletions.
16 changes: 8 additions & 8 deletions deploy/helm/sumologic/conf/logs/fluentd/logs.source.default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
{{- .Values.fluentd.logs.default.extraFilterPluginConf | nindent 4 }}
<filter **>
@type kubernetes_sumologic
source_name {{ .Values.fluentd.logs.default.sourceName | quote }}
source_category {{ .Values.fluentd.logs.default.sourceCategory | quote }}
source_category_prefix {{ .Values.fluentd.logs.default.sourceCategoryPrefix | quote }}
source_category_replace_dash {{ .Values.fluentd.logs.default.sourceCategoryReplaceDash | quote }}
exclude_facility_regex {{ .Values.fluentd.logs.default.excludeFacilityRegex | quote }}
exclude_host_regex {{ .Values.fluentd.logs.default.excludeHostRegex | quote }}
exclude_priority_regex {{ .Values.fluentd.logs.default.excludePriorityRegex | quote }}
exclude_unit_regex {{ .Values.fluentd.logs.default.excludeUnitRegex | quote }}
source_name {{ .Values.sumologic.logs.defaultFluentd.sourceName | quote }}
source_category {{ .Values.sumologic.logs.defaultFluentd.sourceCategory | quote }}
source_category_prefix {{ .Values.sumologic.logs.defaultFluentd.sourceCategoryPrefix | quote }}
source_category_replace_dash {{ .Values.sumologic.logs.defaultFluentd.sourceCategoryReplaceDash | quote }}
exclude_facility_regex {{ .Values.sumologic.logs.defaultFluentd.excludeFacilityRegex | quote }}
exclude_host_regex {{ .Values.sumologic.logs.defaultFluentd.excludeHostRegex | quote }}
exclude_priority_regex {{ .Values.sumologic.logs.defaultFluentd.excludePriorityRegex | quote }}
exclude_unit_regex {{ .Values.sumologic.logs.defaultFluentd.excludeUnitRegex | quote }}
</filter>
<filter **>
@type record_modifier
Expand Down
54 changes: 28 additions & 26 deletions deploy/helm/sumologic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -297,16 +297,16 @@ sumologic:
sourceCategoryReplaceDash: "/"

## A regular expression for facility.
## Matching facility will be excluded from Sumo. The logs will still be sent to FluentD.
## Matching facility will be excluded from Sumo. The logs will still be sent to logs metadata provider (FluentD/otelcol).
excludeFacilityRegex: ""
## A regular expression for hosts.
## Matching hosts will be excluded from Sumo. The logs will still be sent to FluentD.
## Matching hosts will be excluded from Sumo. The logs will still be sent to logs metadata provider (FluentD/otelcol).
excludeHostRegex: ""
## A regular expression for priority.
## Matching priority will be excluded from Sumo. The logs will still be sent to FluentD.
## Matching priority will be excluded from Sumo. The logs will still be sent to logs metadata provider (FluentD/otelcol).
excludePriorityRegex: ""
## A regular expression for unit.
## Matching unit will be excluded from Sumo. The logs will still be sent to FluentD.
## Matching unit will be excluded from Sumo. The logs will still be sent to logs metadata provider (FluentD/otelcol).
excludeUnitRegex: ""

kubelet:
Expand All @@ -332,6 +332,30 @@ sumologic:
## Matching unit will be excluded from Sumo. The logs will still be sent to logs metadata provider (FluentD/otelcol).
excludeUnitRegex: ""

## Only for Fluentd - default log configuration (catch-all)
defaultFluentd:
## Set the _sourceName metadata field in Sumo Logic.
sourceName: "k8s_default"
## Set the _sourceCategory metadata field in Sumo Logic.
sourceCategory: "default"
## Set the prefix, for _sourceCategory metadata.
sourceCategoryPrefix: "kubernetes/"
## Used to replace - with another character.
sourceCategoryReplaceDash: "/"

## A regular expression for facility.
## Matching facility will be excluded from Sumo. The logs will still be sent to FluentD.
excludeFacilityRegex: ""
## A regular expression for hosts.
## Matching hosts will be excluded from Sumo. The logs will still be sent to FluentD.
excludeHostRegex: ""
## A regular expression for priority.
## Matching priority will be excluded from Sumo. The logs will still be sent to FluentD.
excludePriorityRegex: ""
## A regular expression for unit.
## Matching unit will be excluded from Sumo. The logs will still be sent to FluentD.
excludeUnitRegex: ""

## Fields to be created at Sumo Logic to ensure logs are tagged with
## relevant metadata.
## https://help.sumologic.com/docs/manage/fields/#manage-fields
Expand Down Expand Up @@ -744,28 +768,6 @@ fluentd:
## Override output section for untagged logs. Leave empty for the default output section.
overrideOutputConf: |-
## Set the _sourceName metadata field in Sumo Logic.
sourceName: "k8s_default"
## Set the _sourceCategory metadata field in Sumo Logic.
sourceCategory: "default"
## Set the prefix, for _sourceCategory metadata.
sourceCategoryPrefix: "kubernetes/"
## Used to replace - with another character.
sourceCategoryReplaceDash: "/"

## A regular expression for facility.
## Matching facility will be excluded from Sumo. The logs will still be sent to FluentD.
excludeFacilityRegex: ""
## A regular expression for hosts.
## Matching hosts will be excluded from Sumo. The logs will still be sent to FluentD.
excludeHostRegex: ""
## A regular expression for priority.
## Matching priority will be excluded from Sumo. The logs will still be sent to FluentD.
excludePriorityRegex: ""
## A regular expression for unit.
## Matching unit will be excluded from Sumo. The logs will still be sent to FluentD.
excludeUnitRegex: ""

## Extra Environment Values - allows yaml definitions
# extraEnvVars:
# - name: VALUE_FROM_SECRET
Expand Down
8 changes: 0 additions & 8 deletions tests/helm/metadata_logs_fluentd/static/default_v2.input.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ sumologic:
sourceHost: # in v2 this parameter is not set in values.yaml
sourceName: "%{namespace}.%{pod}.%{container}"
sourceCategory: "%{namespace}/%{pod_name}"
sourceCategoryPrefix: "kubernetes/"
sourceCategoryReplaceDash: "/"
excludeContainerRegex: ""
excludeHostRegex: ""
excludeNamespaceRegex: ""
excludePodRegex: ""
perContainerAnnotationsEnabled: false
perContainerAnnotationPrefixes: []

systemd:
enabled: true
Expand Down
10 changes: 10 additions & 0 deletions tests/helm/metadata_logs_fluentd/static/templates.input.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,13 @@ sumologic:
excludeHostRegex: my_systemd_excludeHostRegex
excludePriorityRegex: my_systemd_excludePriorityRegex
excludeUnitRegex: my_systemd_excludeUnitRegex

defaultFluentd:
sourceName: my_defaultFluentd_sourceName
sourceCategory: my_defaultFluentd_sourceCategory
sourceCategoryPrefix: my_defaultFluentd_sourceCategoryPrefix
sourceCategoryReplaceDash: my_defaultFluentd_sourceCategoryReplaceDash
excludeFacilityRegex: my_defaultFluentd_excludeFacilityRegex
excludeHostRegex: my_defaultFluentd_excludeHostRegex
excludePriorityRegex: my_defaultFluentd_excludePriorityRegex
excludeUnitRegex: my_defaultFluentd_excludeUnitRegex
16 changes: 8 additions & 8 deletions tests/helm/metadata_logs_fluentd/static/templates.output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,14 @@ data:
<filter **>
@type kubernetes_sumologic
source_name "k8s_default"
source_category "default"
source_category_prefix "kubernetes/"
source_category_replace_dash "/"
exclude_facility_regex ""
exclude_host_regex ""
exclude_priority_regex ""
exclude_unit_regex ""
source_name "my_defaultFluentd_sourceName"
source_category "my_defaultFluentd_sourceCategory"
source_category_prefix "my_defaultFluentd_sourceCategoryPrefix"
source_category_replace_dash "my_defaultFluentd_sourceCategoryReplaceDash"
exclude_facility_regex "my_defaultFluentd_excludeFacilityRegex"
exclude_host_regex "my_defaultFluentd_excludeHostRegex"
exclude_priority_regex "my_defaultFluentd_excludePriorityRegex"
exclude_unit_regex "my_defaultFluentd_excludeUnitRegex"
</filter>
<filter **>
@type record_modifier
Expand Down

0 comments on commit a2e0daf

Please sign in to comment.