Skip to content

Commit

Permalink
Apply Doc Cloud changes to version 1.1.0
Browse files Browse the repository at this point in the history
Log different namespaces to different indexes.
Add environment and region to host name.
  • Loading branch information
cdmurph32 committed May 14, 2019
1 parent ec00d8f commit 72a6b66
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion helm-chart/splunk-connect-for-kubernetes/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: splunk-connect-for-kubernetes
version: 1.1.0
version: 1.1.0-dc1
description: Collect logs, objects (metadata), and metrics with Splunk.
home: https://github.com/splunk/splunk-connect-for-kubernetes/tree/master/helm-chart
sources:
Expand Down
2 changes: 1 addition & 1 deletion helm-chart/splunk-kubernetes-logging/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
version: 1.1.0
version: 1.1.0-dc1
name: splunk-kubernetes-logging
description: Collect logs with Splunk.
home: https://github.com/splunk/splunk-connect-for-kubernetes/tree/master/helm-chart/charts/splunk-kubernetes-logging
Expand Down
12 changes: 8 additions & 4 deletions helm-chart/splunk-kubernetes-logging/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,15 @@ else empty
end;

def set_namespace(value):
if value == "default"
then
{{- $index := or .Values.splunk.hec.indexRoutingDefaultIndex .Values.global.splunk.hec.indexRoutingDefaultIndex | default "main" | quote}}
if value == "preview"
then "sign-preview-ue1"
elif value == "stage"
then "sign-stage-ue1"
elif value == "prod"
then "sign-prod-ue1"
else
{{- $index := or .Values.splunk.hec.indexName .Values.global.splunk.hec.indexName | default "main" | quote}}
{{- printf " %s" $index -}}
else value
end;

def extract_container_info:
Expand Down
10 changes: 9 additions & 1 deletion helm-chart/splunk-kubernetes-logging/templates/configMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ data:
output.conf: |-
<label @SPLUNK>
# filter to remove empty lines
<filter tail.containers.**>
@type grep
<exclude>
key log
pattern ^$
</exclude>
</filter>
# = filters for container logs =
{{- range $name, $logDef := .Values.logs }}
{{- if and $logDef.from.pod $logDef.multiline }}
Expand Down Expand Up @@ -207,7 +215,7 @@ data:
hec_port {{ . }}
{{- end }}
hec_token "#{ENV['SPLUNK_HEC_TOKEN']}"
host "#{ENV['SPLUNK_HEC_HOST']}"
host "#{ENV['SPLUNK_HEC_HOST']}{{ "," }}{{ .Values.global.splunk.environment }}{{ "," }}{{ .Values.global.splunk.region }}"
source_key source
sourcetype_key sourcetype
{{- if or .Values.splunk.hec.indexRouting .Values.global.splunk.hec.indexRouting }}
Expand Down
2 changes: 2 additions & 0 deletions helm-chart/splunk-kubernetes-logging/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ global:
indexRouting:
# indexRoutingDefaultIndex tells which index to use for the default kubenetes namespace. Used with indexRouting. Default is main.
indexRoutingDefaultIndex:
region:
environment:


# logLevel is to set log level of the Splunk log collector. Avaiable values are:
Expand Down
2 changes: 1 addition & 1 deletion helm-chart/splunk-kubernetes-metrics/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
version: 1.1.0
version: 1.1.0-dc1
name: splunk-kubernetes-metrics
description: Collect metrics with Splunk.
home: https://github.com/splunk/splunk-connect-for-kubernetes/tree/master/helm-chart/charts/splunk-kubernetes-metrics
Expand Down
2 changes: 1 addition & 1 deletion helm-chart/splunk-kubernetes-objects/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
version: 1.1.0
version: 1.1.0-dc1
name: splunk-kubernetes-objects
description: Collect Kubernetes objects with Splunk.
home: https://github.com/splunk/splunk-connect-for-kubernetes/tree/master/helm-chart/charts/splunk-kubernetes-objects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ data:
{{- if $.Values.kubernetes.clientKey }}
client_key /fluentd/etc/splunk/k8s_client_key
{{- end }}
{{- if $.Values.kubernetes.caFile }}
ca_file /fluentd/etc/splunk/k8s_ca_file
{{- end }}
ca_file /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
{{- with $.Values.kubernetes.bearerTokenFile }}
bearer_token_file {{ . }}
{{- end }}
Expand Down

0 comments on commit 72a6b66

Please sign in to comment.