Skip to content

Commit

Permalink
Keep container log timestamps (#38)
Browse files Browse the repository at this point in the history
* Keep container log timestamps

Signed-off-by: Guillermo Rodriguez <[email protected]>

* Increase minor version of the chart

Signed-off-by: Guillermo Rodriguez <[email protected]>

* Update Chart.yaml

Co-authored-by: André Bauer <[email protected]>
  • Loading branch information
Spritekin and monotek authored Dec 8, 2020
1 parent 698d207 commit 18d1b5d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/fluentd-elasticsearch/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: fluentd-elasticsearch
version: 11.2.0
version: 11.3.0
appVersion: 3.1.0
type: application
home: https://www.fluentd.org/
Expand Down
1 change: 1 addition & 0 deletions charts/fluentd-elasticsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ The following table lists the configurable parameters of the Fluentd elasticsear
| `podAnnotations` | Optional daemonset's pods annotations | `NULL` |
| `configMaps.useDefaults.systemConf` | Use default system.conf | `true` |
| `configMaps.useDefaults.containersInputConf` | Use default containers.input.conf | `true` |
| `configMaps.useDefaults.containersKeepTimeKey` | Keep the container log timestamp as part of the log data. | `false` |
| `configMaps.useDefaults.systemInputConf` | Use default system.input.conf | `true` |
| `configMaps.useDefaults.forwardInputConf` | Use default forward.input.conf | `true` |
| `configMaps.useDefaults.monitoringConf` | Use default monitoring.conf | `true` |
Expand Down
6 changes: 6 additions & 0 deletions charts/fluentd-elasticsearch/templates/configmaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,16 @@ data:
format json
time_key time
time_format %Y-%m-%dT%H:%M:%S.%NZ
{{- if .Values.configMaps.useDefaults.containersKeepTimeKey }}
keep_time_key true
{{- end }}
</pattern>
<pattern>
format /^(?<time>.+) (?<stream>stdout|stderr) [^ ]* (?<log>.*)$/
time_format %Y-%m-%dT%H:%M:%S.%N%:z
{{- if .Values.configMaps.useDefaults.containersKeepTimeKey }}
keep_time_key true
{{- end }}
</pattern>
</parse>
</source>
Expand Down
3 changes: 3 additions & 0 deletions charts/fluentd-elasticsearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ configMaps:
useDefaults:
systemConf: true
containersInputConf: true
## Set containersKeepTimeKey to true to keep the kubernetes container log timestamp as part of the log message
## Read keep_time_key at https://docs.fluentd.org/configuration/parse-section
containersKeepTimeKey: false
systemInputConf: true
forwardInputConf: true
monitoringConf: true
Expand Down

0 comments on commit 18d1b5d

Please sign in to comment.