Skip to content

Commit

Permalink
Set k8s.node.name and k8s.cluster name logs fields (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryax authored Oct 7, 2020
1 parent 5a9a478 commit afbcc4b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions helm-charts/o11y-collector/templates/configmap-fluentd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,9 @@ data:
pod ${record.dig("kubernetes","pod_name")}
container_id ${record.dig("docker","container_id")}
pod_uid ${record.dig("kubernetes","pod_id")}
node_name "#{ENV['K8S_NODE_NAME']}"
cluster_name {{ .Values.clusterName }}
container_image ${record.dig("kubernetes","container_image")}
# set the cluster_name field to the configured value, or default to "cluster_name"
{{- with .Values.clusterName }}
cluster_name {{ . }}
{{- end }}
# set the index field to the value found in the pod splunk.com/index annotations. if not set, use namespace annotation, or default to the default_index
index ${record.dig("kubernetes", "annotations", "splunk.com/index") ? record.dig("kubernetes", "annotations", "splunk.com/index") : record.dig("kubernetes", "namespace_annotations", "splunk.com/index") ? (record["kubernetes"]["namespace_annotations"]["splunk.com/index"]) : ("{{ .Values.logsBackend.hec.indexName | default "main"}}")}
{{- range .Values.extraAttributes.podLabels }}
Expand Down Expand Up @@ -356,8 +354,9 @@ data:
k8s.pod.name pod
k8s.container.name container_name
k8s.namespace.name namespace
k8s.node.name node_name
k8s.cluster.name cluster_name
container.id container_id
k8s.cluster.name {{ .Values.clusterName }}
{{- range .Values.extraAttributes.custom }}
{{ .name }}
{{- end }}
Expand Down

0 comments on commit afbcc4b

Please sign in to comment.