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

Filebeat: Add option to convert kafka module timezones to UTC #7578

Merged
merged 1 commit into from
Jul 16, 2018
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ https://github.com/elastic/beats/compare/v6.2.3...master[Check the HEAD diff]
- Add Audit log fileset to the Elasticsearch module. {pull}7365[7365]
- Add Slow log fileset to the Elasticsearch module. {pull}7473[7473]
- Add deprecation fileset to the Elasticsearch module. {pull}7474[7474]
- Add `config_timezone` option to Kafka module to convert dates to UTC. {issue}7546[7546] {pull}7578[7578]
Copy link
Contributor

Choose a reason for hiding this comment

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

@jsoriano I think this line should say convert_timezone, not config_timezone, correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct, I'll open a PR to fix this.

Copy link
Member Author

Choose a reason for hiding this comment

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


*Heartbeat*

Expand Down
2 changes: 2 additions & 0 deletions filebeat/docs/modules/kafka.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ include::../include/config-option-intro.asciidoc[]

include::../include/var-paths.asciidoc[]

include::../include/var-convert-timezone.asciidoc[]


[float]
=== Fields
Expand Down
2 changes: 2 additions & 0 deletions filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ filebeat.modules:
# Filebeat will choose the paths depending on your OS.
#var.paths:

# Convert the timestamp to UTC. Requires Elasticsearch >= 6.1.
#var.convert_timezone: false

#------------------------------- kibana Module -------------------------------
- module: kibana
Expand Down
2 changes: 2 additions & 0 deletions filebeat/module/kafka/_meta/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
# Filebeat will choose the paths depending on your OS.
#var.paths:

# Convert the timestamp to UTC. Requires Elasticsearch >= 6.1.
#var.convert_timezone: false
2 changes: 2 additions & 0 deletions filebeat/module/kafka/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ include::../include/config-option-intro.asciidoc[]
==== `log` fileset settings

include::../include/var-paths.asciidoc[]

include::../include/var-convert-timezone.asciidoc[]
4 changes: 4 additions & 0 deletions filebeat/module/kafka/log/config/log.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ multiline:
pattern: '^\['
negate: true
match: after
{{ if .convert_timezone }}
processors:
- add_locale: ~
{{ end }}
4 changes: 3 additions & 1 deletion filebeat/module/kafka/log/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@
"date": {
"field": "kafka.log.timestamp",
"target_field": "@timestamp",
"formats": ["yyyy-MM-dd HH:mm:ss,SSS"]
"formats": ["yyyy-MM-dd HH:mm:ss,SSS"],
{< if .convert_timezone >}"timezone": "{{ beat.timezone }}",{< end >}
"ignore_failure": true
}
},
{"remove": {"field": "kafka.log.timestamp" }}
Expand Down
7 changes: 7 additions & 0 deletions filebeat/module/kafka/log/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ var:
- "{{.kafka_home}}/logs/server.log*"
- "{{.kafka_home}}/logs/state-change.log*"
- "{{.kafka_home}}/logs/kafka-*.log*"
- name: convert_timezone
default: false
# if ES < 6.1.0, this flag switches to false automatically when evaluating the
# pipeline
min_elasticsearch_version:
Copy link
Contributor

Choose a reason for hiding this comment

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

I completely forgot we have this feature. Nice.

Copy link
Member Author

Choose a reason for hiding this comment

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

I copied this part from the system module 😄

version: 6.1.0
value: false

ingest_pipeline: ingest/pipeline.json
input: config/log.yml
2 changes: 2 additions & 0 deletions filebeat/modules.d/kafka.yml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
# Filebeat will choose the paths depending on your OS.
#var.paths:

# Convert the timestamp to UTC. Requires Elasticsearch >= 6.1.
#var.convert_timezone: false