Skip to content

Commit

Permalink
feat(logs): add sumologic.logs.additionalFields property
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzej-stencel committed Sep 20, 2023
1 parent cde9212 commit 73e8b0a
Show file tree
Hide file tree
Showing 6 changed files with 819 additions and 0 deletions.
1 change: 1 addition & 0 deletions .changelog/3286.added.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat(logs): add `sumologic.logs.additionalFields` property
1 change: 1 addition & 0 deletions deploy/helm/sumologic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ The following table lists the configurable parameters of the Sumo Logic chart an
| `sumologic.logs.defaultFluentd.excludePriorityRegex` | Configuration option only for Fluentd, a regular expression for priority. Matching priority will be excluded from Sumo. The logs will still be sent to FluentD. | `""` |
| `sumologic.logs.defaultFluentd.excludeUnitRegex` | Configuration option only for Fluentd, a regular expression for unit. Matching unit will be excluded from Sumo. The logs will still be sent to FluentD. . | `""` |
| `sumologic.logs.fields` | Fields to be created at Sumo Logic to ensure logs are tagged with relevant metadata. [Sumo Logic help](https://help.sumologic.com/docs/manage/fields/#manage-fields) | `["cluster", "container", "daemonset", "deployment", "host", "namespace", "node", "pod", "service", "statefulset"]` |
| `sumologic.logs.additionalFields` | Additional Fields to be created in Sumo Logic. [Sumo Logic help](https://help.sumologic.com/docs/manage/fields/#manage-fields) | `[]` |
| `sumologic.logs.metadata.provider` | Defines logs metadata enrichment provider - `otelcol` or `fluentd`. `otelcol` is the default and is recommended. `fluentd` is deprecated. | `otelcol` |
| `sumologic.logs.sourceType` | The type of the Sumo Logic source being used for logs ingestion. Can be `http` for [HTTP Source](https://help.sumologic.com/docs/send-data/hosted-collectors/http-source/logs-metrics/) or `otlp` for [OTLP/HTTP Source](https://help.sumologic.com/docs/send-data/hosted-collectors/http-source/otlp/). | `http` |
| `sumologic.metrics.enabled` | Set the enabled flag to false for disabling metrics ingestion altogether. | `true` |
Expand Down
16 changes: 16 additions & 0 deletions deploy/helm/sumologic/conf/setup/fields.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,19 @@ resource "sumologic_field" {{ $value | quote }} {
state = "Enabled"
}
{{- end }}

{{- range $value := .Values.sumologic.logs.additionalFields }}
resource "sumologic_field" {{ $value | quote }} {
count = var.create_fields ? 1 : 0

lifecycle {
# ignore changes for name and type, as older installations have been case sensitive
# see: https://github.com/SumoLogic/sumologic-kubernetes-collection/issues/2865
ignore_changes = [field_name, data_type]
}

field_name = {{ $value | quote }}
data_type = "String"
state = "Enabled"
}
{{- end }}
4 changes: 4 additions & 0 deletions deploy/helm/sumologic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@ sumologic:
- service
- statefulset

## Additional fields to be created in Sumo Logic.
## https://help.sumologic.com/docs/manage/fields/#manage-fields
additionalFields: []

sourceType: http

### Metrics configuration
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sumologic:
logs:
additionalFields:
- addfield1
- addfield2
Loading

0 comments on commit 73e8b0a

Please sign in to comment.