diff --git a/examples/kubernetes-windows-nodes/rendered_manifests/configmap-agent.yaml b/examples/kubernetes-windows-nodes/rendered_manifests/configmap-agent.yaml index 035f7a72ad..914ca0dcdc 100644 --- a/examples/kubernetes-windows-nodes/rendered_manifests/configmap-agent.yaml +++ b/examples/kubernetes-windows-nodes/rendered_manifests/configmap-agent.yaml @@ -257,9 +257,9 @@ data: - k8sattributes - filter/logs - batch + - resource - resource/logs - resourcedetection - - resource receivers: - fluentforward - otlp diff --git a/examples/kubernetes-windows-nodes/rendered_manifests/daemonset.yaml b/examples/kubernetes-windows-nodes/rendered_manifests/daemonset.yaml index ac69d093d4..35f0663e23 100644 --- a/examples/kubernetes-windows-nodes/rendered_manifests/daemonset.yaml +++ b/examples/kubernetes-windows-nodes/rendered_manifests/daemonset.yaml @@ -30,7 +30,7 @@ spec: app: splunk-otel-collector release: default annotations: - checksum/config: 9b4c6e5189c4f33ba448dfbdbe5e03c75d6a04e319452f4ba8e258fe52997bba + checksum/config: cac82800ded432062648f452c76ef29b6d1032da473a2a5dd4e6e77cddf5359e kubectl.kubernetes.io/default-container: otel-collector spec: dnsPolicy: ClusterFirstWithHostNet diff --git a/examples/only-logs-fluentd/rendered_manifests/configmap-agent.yaml b/examples/only-logs-fluentd/rendered_manifests/configmap-agent.yaml index d2014c17ff..c87e6b668c 100644 --- a/examples/only-logs-fluentd/rendered_manifests/configmap-agent.yaml +++ b/examples/only-logs-fluentd/rendered_manifests/configmap-agent.yaml @@ -171,9 +171,9 @@ data: - k8sattributes - filter/logs - batch + - resource - resource/logs - resourcedetection - - resource receivers: - fluentforward - otlp diff --git a/examples/only-logs-fluentd/rendered_manifests/daemonset.yaml b/examples/only-logs-fluentd/rendered_manifests/daemonset.yaml index 1633acd287..b1a3b7b488 100644 --- a/examples/only-logs-fluentd/rendered_manifests/daemonset.yaml +++ b/examples/only-logs-fluentd/rendered_manifests/daemonset.yaml @@ -30,7 +30,7 @@ spec: app: splunk-otel-collector release: default annotations: - checksum/config: 23076ae4687ac47f216f076d5dab7dab6e03d3b4d3f926c8e05de9ced7112821 + checksum/config: c72a5536ce2ddd9792af9317f7d0f7b61e52a9f46c9e1819f79075f3da4c0311 kubectl.kubernetes.io/default-container: otel-collector spec: hostNetwork: true diff --git a/examples/only-logs-otel/rendered_manifests/configmap-agent.yaml b/examples/only-logs-otel/rendered_manifests/configmap-agent.yaml index d8fc265612..78f6a88acc 100644 --- a/examples/only-logs-otel/rendered_manifests/configmap-agent.yaml +++ b/examples/only-logs-otel/rendered_manifests/configmap-agent.yaml @@ -262,9 +262,9 @@ data: - k8sattributes - filter/logs - batch + - resource - resource/logs - resourcedetection - - resource receivers: - filelog - fluentforward diff --git a/examples/only-logs-otel/rendered_manifests/daemonset.yaml b/examples/only-logs-otel/rendered_manifests/daemonset.yaml index 52266f130b..ded189f4b8 100644 --- a/examples/only-logs-otel/rendered_manifests/daemonset.yaml +++ b/examples/only-logs-otel/rendered_manifests/daemonset.yaml @@ -29,7 +29,7 @@ spec: app: splunk-otel-collector release: default annotations: - checksum/config: beb070897643ff6ccde9c4f764e43d8ca1aa59462a6df49f1e0b109c9e9a2726 + checksum/config: 3248106e33590fd0e8b4b44a6dab21c89107ed723dd47f5cdc68f5e98928d2e7 kubectl.kubernetes.io/default-container: otel-collector spec: hostNetwork: true diff --git a/examples/splunk-enterprise-index-routing/rendered_manifests/configmap-agent.yaml b/examples/splunk-enterprise-index-routing/rendered_manifests/configmap-agent.yaml index a7307ffe87..d2f6285b3c 100644 --- a/examples/splunk-enterprise-index-routing/rendered_manifests/configmap-agent.yaml +++ b/examples/splunk-enterprise-index-routing/rendered_manifests/configmap-agent.yaml @@ -181,9 +181,9 @@ data: - k8sattributes - filter/logs - batch + - resource - resource/logs - resourcedetection - - resource receivers: - fluentforward - otlp diff --git a/examples/splunk-enterprise-index-routing/rendered_manifests/daemonset.yaml b/examples/splunk-enterprise-index-routing/rendered_manifests/daemonset.yaml index 20a24bc217..feb2951b11 100644 --- a/examples/splunk-enterprise-index-routing/rendered_manifests/daemonset.yaml +++ b/examples/splunk-enterprise-index-routing/rendered_manifests/daemonset.yaml @@ -30,7 +30,7 @@ spec: app: splunk-otel-collector release: default annotations: - checksum/config: 06c3daf120705029797394a1b5faee57ac67280eb59715fc8719517e72b9079b + checksum/config: 8ac5436b5288b63f3fd36651cdac742c6e722ed0b62349349718ff0824611e09 kubectl.kubernetes.io/default-container: otel-collector spec: hostNetwork: true diff --git a/helm-charts/splunk-otel-collector/templates/config/_common.tpl b/helm-charts/splunk-otel-collector/templates/config/_common.tpl index 24b596fc3a..a6cf85de74 100644 --- a/helm-charts/splunk-otel-collector/templates/config/_common.tpl +++ b/helm-charts/splunk-otel-collector/templates/config/_common.tpl @@ -133,6 +133,9 @@ resource/logs: - key: namespace from_attribute: k8s.namespace.name action: upsert + - key: label_app + from_attribute: k8s.pod.labels.app + action: upsert {{- range $_, $label := .Values.extraAttributes.podLabels }} - key: {{ printf "label_%s" $label }} from_attribute: {{ printf "k8s.pod.labels.%s" $label }} @@ -151,6 +154,8 @@ resource/logs: action: delete - key: k8s.namespace.name action: delete + - key: k8s.pod.labels.app + action: delete {{- range $_, $label := .Values.extraAttributes.podLabels }} - key: {{ printf "k8s.pod.labels.%s" $label }} action: delete diff --git a/helm-charts/splunk-otel-collector/templates/config/_otel-agent.tpl b/helm-charts/splunk-otel-collector/templates/config/_otel-agent.tpl index 0cc400286d..12eb8e64e5 100644 --- a/helm-charts/splunk-otel-collector/templates/config/_otel-agent.tpl +++ b/helm-charts/splunk-otel-collector/templates/config/_otel-agent.tpl @@ -500,6 +500,13 @@ processors: {{- if not $gatewayEnabled }} {{- include "splunk-otel-collector.resourceLogsProcessor" . | nindent 2 }} {{- include "splunk-otel-collector.filterLogsProcessors" . | nindent 2 }} + {{- if .Values.splunkPlatform.fieldNameConvention.renameFieldsSck }} + transform/logs: + log_statements: + - context: log + statements: + - set(resource.attributes["container_image"], Concat([resource.attributes["container.image.name"],resource.attributes["container.image.tag"]], ":")) + {{- end }} {{- end }} {{- include "splunk-otel-collector.otelMemoryLimiterConfig" . | nindent 2 }} @@ -644,11 +651,14 @@ service: - filter/logs {{- end }} - batch + - resource {{- if not $gatewayEnabled }} + {{- if .Values.splunkPlatform.fieldNameConvention.renameFieldsSck }} + - transform/logs + {{- end }} - resource/logs {{- end }} - resourcedetection - - resource {{- if .Values.environment }} - resource/add_environment {{- end }}