Skip to content

Commit 49fba52

Browse files
authored
Change the way to configure "concat" filter for container logs (#117)
- Add support to configure the "concat" filter section to be applied for all the container logs. For example, to parse multiline java stack trace from every container: ``` fluentd: config: logs: java-stacktrace: from: pod: "*" multiline: firstline: /\d{4}-\d{1,2}-\d{1,2}/ ``` - Do not use the name of the source as fallback for `container` field. If `container` value is not set, apply configuration to all containers in the pod.
1 parent 9215dc3 commit 49fba52

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
44

55
## [Unreleased]
66

7+
## [0.24.11] - 2021-04-29
8+
9+
- Change the way to configure "concat" filter for container logs (#117)
10+
711
## [0.24.10] - 2021-04-21
812

913
### 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.10
3+
version: 0.24.11
44
description: Splunk OpenTelemetry Connector for Kubernetes
55
icon: https://github.com/signalfx/splunk-otel-collector-chart/tree/main/splunk.png
66
type: application

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ data:
167167
# = filters for container logs =
168168
{{- range $name, $logDef := .Values.fluentd.config.logs }}
169169
{{- if and $logDef.from.pod $logDef.multiline }}
170-
<filter tail.containers.var.log.containers.{{ $logDef.from.pod }}*{{ or $logDef.from.container $name }}*.log>
170+
{{- $filenameGlob := regexReplaceAll "\\*+" (printf "%s*%s*" $logDef.from.pod ($logDef.from.container | default "")) "*" }}
171+
<filter tail.containers.var.log.containers.{{ $filenameGlob }}.log>
171172
@type concat
172173
key log
173174
timeout_label @SPLUNK

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,10 @@ fluentd:
346346
# path: /var/log/docker.log
347347
# ```
348348
#
349-
# For `container` logs, pod name is required. You can also provide the container name, if it's not provided, the name of this source will be used as the container name:
349+
# For `container` logs, `pod` field is required. It represents part of
350+
# the pod name, can be name of a deployment or replica set. Use "*" to
351+
# apply the configuration to all pods. Optional `container` value can be
352+
# used to apply configuration to a particular container.
350353
# ```
351354
# kube-apiserver:
352355
# from:

0 commit comments

Comments
 (0)