Add full object with stage replace block
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
This commit is contained in:
parent
04cf591478
commit
9dd6584bee
@ -18,7 +18,7 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- define "agent.loki_process_targets" -}}
|
{{- define "agent.loki_process_targets" -}}
|
||||||
{{- if empty .Values.logs.piiregexes }}
|
{{- if empty .Values.logs.piiRegexes }}
|
||||||
{{- include "agent.loki_write_targets" . }}
|
{{- include "agent.loki_write_targets" . }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- printf "loki.process.PII.receiver" }}
|
{{- printf "loki.process.PII.receiver" }}
|
||||||
|
@ -43,14 +43,15 @@ data:
|
|||||||
forward_to = [ {{ include "agent.loki_process_targets" . }} ]
|
forward_to = [ {{ include "agent.loki_process_targets" . }} ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{{- if not (empty .Values.logs.piiregexes) }}
|
{{- if not (empty .Values.logs.piiRegexes) }}
|
||||||
loki.process "PII" {
|
loki.process "PII" {
|
||||||
forward_to = [ {{ include "agent.loki_write_targets" . }} ]
|
forward_to = [ {{ include "agent.loki_write_targets" . }} ]
|
||||||
|
|
||||||
{{- range .Values.logs.piiregexes }}
|
{{- range .Values.logs.piiRegexes }}
|
||||||
stage.replace {
|
stage.replace {
|
||||||
expression = "{{ . }}"
|
expression = "{{ .expression }}"
|
||||||
replace = "*****"
|
source = "{{ .source }}"
|
||||||
|
replace = "{{ .replace }}"
|
||||||
}
|
}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
}
|
}
|
||||||
|
@ -32,14 +32,14 @@ cloud:
|
|||||||
username:
|
username:
|
||||||
password:
|
password:
|
||||||
|
|
||||||
# Adding regexes here will add a stage.replace block that parses the log lines using a regular expression
|
# Adding regexes here will add a stage.replace block. For more information see
|
||||||
# and replaces the capture group in the regex with "*****".
|
# https://grafana.com/docs/agent/latest/flow/reference/components/loki.process/#stagereplace-block
|
||||||
# For example the regex "password (\\S+)" will replace the line
|
|
||||||
# we should not be logging the password xyzabc at all
|
|
||||||
# with:
|
|
||||||
# we should not be logging the password ***** at all
|
|
||||||
logs:
|
logs:
|
||||||
piiregexes:
|
piiRegexes:
|
||||||
|
# This example replaces the word after password with *****
|
||||||
|
# - expression: "password (\\\\S+)"
|
||||||
|
# source: "" # Empty uses the log message
|
||||||
|
# replace: "*****""
|
||||||
|
|
||||||
global:
|
global:
|
||||||
minio:
|
minio:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user