Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes fluentd configuration params in fluentd-elasticsearch addon #67947

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions cluster/addons/fluentd-elasticsearch/fluentd-es-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ data:
@type tail
path /var/log/containers/*.log
pos_file /var/log/es-containers.log.pos
time_format %Y-%m-%dT%H:%M:%S.%NZ
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of removing this line, can you add time_type string? this will cause the specified time_format to be applied

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coffeepac
Thanks. Looks like time parameters (time_type, time_format,..) are only applicable to <parse> section of source plugin tail. If we use this params outside parse section in tail plugin then fluentd seems ignoring these params and we are getting the warnings.

I got the below errors/warnings when I tried to add time_type string , please correct me if I am wrong.

2018-08-28 17:28:59 +0000 [warn]: parameter 'time_format' in <source>
  @id fluentd-containers.log
  @type tail
  path "/var/log/containers/*.log"
  pos_file "/var/log/es-containers.log.pos"
  time_format %Y-%m-%dT%H:%M:%S.%NZ
  time_type string
  estimate_current_event false
  refresh_interval 20
  tag "raw.kubernetes.*"
  read_from_head true
  <parse>
    @type "multi_format"
    <pattern>
      format json
      time_key "time"
      time_format "%Y-%m-%dT%H:%M:%S.%NZ"
      time_type string
    </pattern>
    <pattern>
      format /^(?<time>.+) (?<stream>stdout|stderr) [^ ]* (?<log>.*)$/
      time_format "%Y-%m-%dT%H:%M:%S.%N%:z"
      expression ^(?<time>.+) (?<stream>stdout|stderr) [^ ]* (?<log>.*)$
      ignorecase false
      multiline false
    </pattern>
  </parse>
</source> is not used.
2018-08-28 17:28:59 +0000 [warn]: parameter 'time_type' in <source>
  @id fluentd-containers.log
  @type tail
  path "/var/log/containers/*.log"
  pos_file "/var/log/es-containers.log.pos"
  time_format %Y-%m-%dT%H:%M:%S.%NZ
  time_type string
  estimate_current_event false
  refresh_interval 20
  tag "raw.kubernetes.*"
  read_from_head true
  <parse>
    @type "multi_format"
    <pattern>
      format json
      time_key "time"
      time_format "%Y-%m-%dT%H:%M:%S.%NZ"
      time_type string
    </pattern>
    <pattern>
      format /^(?<time>.+) (?<stream>stdout|stderr) [^ ]* (?<log>.*)$/
      time_format "%Y-%m-%dT%H:%M:%S.%N%:z"
      expression ^(?<time>.+) (?<stream>stdout|stderr) [^ ]* (?<log>.*)$
      ignorecase false
      multiline false
    </pattern>
  </parse>
</source> is not used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, okay, I was misreading the docs then.

looks good!

tag raw.kubernetes.*
read_from_head true
<parse>
Expand Down Expand Up @@ -308,7 +307,7 @@ data:
<source>
@id journald-docker
@type systemd
filters [{ "_SYSTEMD_UNIT": "docker.service" }]
matches [{ "_SYSTEMD_UNIT": "docker.service" }]
<storage>
@type local
persistent true
Expand All @@ -321,7 +320,7 @@ data:
<source>
@id journald-container-runtime
@type systemd
filters [{ "_SYSTEMD_UNIT": "{{ container_runtime }}.service" }]
matches [{ "_SYSTEMD_UNIT": "{{ container_runtime }}.service" }]
<storage>
@type local
persistent true
Expand All @@ -334,7 +333,7 @@ data:
<source>
@id journald-kubelet
@type systemd
filters [{ "_SYSTEMD_UNIT": "kubelet.service" }]
matches [{ "_SYSTEMD_UNIT": "kubelet.service" }]
<storage>
@type local
persistent true
Expand All @@ -347,7 +346,7 @@ data:
<source>
@id journald-node-problem-detector
@type systemd
filters [{ "_SYSTEMD_UNIT": "node-problem-detector.service" }]
matches [{ "_SYSTEMD_UNIT": "node-problem-detector.service" }]
<storage>
@type local
persistent true
Expand All @@ -360,7 +359,7 @@ data:
<source>
@id kernel
@type systemd
filters [{ "_TRANSPORT": "kernel" }]
matches [{ "_TRANSPORT": "kernel" }]
<storage>
@type local
persistent true
Expand Down