Skip to content

Commit 9ffdddd

Browse files
authored
Add host.name by default to fluentd logs (#86)
Related content uses host.name and previously this was being added by a org-only index rule.
1 parent 6cb7e67 commit 9ffdddd

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

helm-charts/splunk-otel-collector/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: splunk-otel-collector
3-
version: 0.24.1
3+
version: 0.24.2
44
description: Splunk OpenTelemetry Connector for Kubernetes
55
type: application
66
keywords:

helm-charts/splunk-otel-collector/templates/configmap-fluentd.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ data:
3535
<source>
3636
@type prometheus_monitor
3737
<labels>
38-
host ${hostname}
38+
host.name ${hostname}
3939
</labels>
4040
</source>
4141
4242
# input plugin that collects metrics for output plugin
4343
<source>
4444
@type prometheus_output_monitor
4545
<labels>
46-
host ${hostname}
46+
host.name ${hostname}
4747
</labels>
4848
</source>
4949
@@ -204,6 +204,12 @@ data:
204204
</match>
205205
</label>
206206
<label @SPLUNK>
207+
<filter **>
208+
@type record_transformer
209+
<record>
210+
host.name "#{ENV['K8S_NODE_NAME']}"
211+
</record>
212+
</filter>
207213
# Enrich log with k8s metadata
208214
<filter tail.containers.**>
209215
@type kubernetes_metadata
@@ -360,6 +366,7 @@ data:
360366
k8s.node.name node_name
361367
k8s.cluster.name cluster_name
362368
container.id container_id
369+
host.name
363370
{{- range .Values.extraAttributes.custom }}
364371
{{ .name }}
365372
{{- end }}

0 commit comments

Comments
 (0)