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

Convert timezones if event.timezone is set #12311

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
10 changes: 9 additions & 1 deletion filebeat/module/elasticsearch/audit/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,18 @@
"formats": [
"ISO8601"
],
{< if .convert_timezone >}"timezone": "{{ event.timezone }}",{< end >}
"ignore_failure": true
}
},
{
"date": {
"if": "ctx.event.timezone != null",
"field": "@timestamp",
"formats": ["ISO8601"],
"timezone": "{{ event.timezone }}",
"on_failure": [{"append": {"field": "error.message", "value": "{{ _ingest.on_failure_message }}"}}]
}
},
{
"remove": {
"field": "elasticsearch.audit.@timestamp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,18 @@
"formats": [
"ISO8601"
],
{< if .convert_timezone >}"timezone": "{{ event.timezone }}",{< end >}
"ignore_failure": true
}
},
{
"date": {
"if": "ctx.event.timezone != null",
"field": "@timestamp",
"formats": ["ISO8601"],
"timezone": "{{ event.timezone }}",
"on_failure": [{"append": {"field": "error.message", "value": "{{ _ingest.on_failure_message }}"}}]
}
},
{
"remove": {
"field": "elasticsearch.deprecation.timestamp"
Expand Down
10 changes: 9 additions & 1 deletion filebeat/module/elasticsearch/server/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,18 @@
"formats": [
"ISO8601"
],
{< if .convert_timezone >}"timezone": "{{ event.timezone }}",{< end >}
"ignore_failure": true
}
},
{
"date": {
"if": "ctx.event.timezone != null",
"field": "@timestamp",
"formats": ["ISO8601"],
"timezone": "{{ event.timezone }}",
"on_failure": [{"append": {"field": "error.message", "value": "{{ _ingest.on_failure_message }}"}}]
}
},
{
"remove": {
"field": "elasticsearch.server.timestamp"
Expand Down
10 changes: 9 additions & 1 deletion filebeat/module/elasticsearch/slowlog/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,18 @@
"formats": [
"ISO8601"
],
{< if .convert_timezone >}"timezone": "{{ event.timezone }}",{< end >}
"ignore_failure": true
}
},
{
"date": {
"if": "ctx.event.timezone != null",
"field": "@timestamp",
"formats": ["ISO8601"],
"timezone": "{{ event.timezone }}",
"on_failure": [{"append": {"field": "error.message", "value": "{{ _ingest.on_failure_message }}"}}]
}
},
{
"remove": {
"field": "elasticsearch.slowlog.timestamp"
Expand Down
10 changes: 9 additions & 1 deletion filebeat/module/kafka/log/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,18 @@
"field": "kafka.log.timestamp",
"target_field": "@timestamp",
"formats": ["yyyy-MM-dd HH:mm:ss,SSS"],
{< if .convert_timezone >}"timezone": "{{ event.timezone }}",{< end >}
"ignore_failure": true
}
},
{
"date": {
"if": "ctx.event.timezone != null",
"field": "@timestamp",
"formats": ["ISO8601"],
"timezone": "{{ event.timezone }}",
"on_failure": [{"append": {"field": "error.message", "value": "{{ _ingest.on_failure_message }}"}}]
}
},
{"remove": {"field": "kafka.log.timestamp" }}
],
"on_failure" : [{
Expand Down
10 changes: 9 additions & 1 deletion filebeat/module/logstash/log/ingest/pipeline-plain.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,18 @@
"formats": [
"ISO8601"
],
{< if .convert_timezone >}"timezone": "{{ event.timezone }}",{< end >}
"ignore_failure": true
}
},
{
"date": {
"if": "ctx.event.timezone != null",
"field": "@timestamp",
"formats": ["ISO8601"],
"timezone": "{{ event.timezone }}",
"on_failure": [{"append": {"field": "error.message", "value": "{{ _ingest.on_failure_message }}"}}]
}
},
{
"remove": {
"field": "logstash.log.timestamp"
Expand Down
10 changes: 9 additions & 1 deletion filebeat/module/logstash/slowlog/ingest/pipeline-plain.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,18 @@
"formats": [
"ISO8601"
],
{< if .convert_timezone >}"timezone": "{{ event.timezone }}",{< end >}
"ignore_failure": true
}
},
{
"date": {
"if": "ctx.event.timezone != null",
"field": "@timestamp",
"formats": ["ISO8601"],
"timezone": "{{ event.timezone }}",
"on_failure": [{"append": {"field": "error.message", "value": "{{ _ingest.on_failure_message }}"}}]
}
},
{
"remove": {
"field": [
Expand Down
10 changes: 9 additions & 1 deletion filebeat/module/nginx/access/ingest/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,18 @@
"formats": [
"dd/MMM/yyyy:H:m:s Z"
],
{< if .convert_timezone >}"timezone": "{{ event.timezone }}",{< end >}
"ignore_failure": true
}
},
{
"date": {
"if": "ctx.event.timezone != null",
"field": "@timestamp",
"formats": ["ISO8601"],
"timezone": "{{ event.timezone }}",
"on_failure": [{"append": {"field": "error.message", "value": "{{ _ingest.on_failure_message }}"}}]
}
},
{
"remove": {
"field": "nginx.access.time"
Expand Down
9 changes: 8 additions & 1 deletion filebeat/module/nginx/error/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@
"field": "nginx.error.time",
"target_field": "@timestamp",
"formats": ["yyyy/MM/dd H:m:s"],
{< if .convert_timezone >}"timezone": "{{ event.timezone }}",{< end >}
"ignore_failure": true
}
}, {
"date": {
"if": "ctx.event.timezone != null",
"field": "@timestamp",
"formats": ["ISO8601"],
"timezone": "{{ event.timezone }}",
"on_failure": [{"append": {"field": "error.message", "value": "{{ _ingest.on_failure_message }}"}}]
}
}, {
"remove": {
"field": "nginx.error.time"
Expand Down
10 changes: 9 additions & 1 deletion filebeat/module/system/auth/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,18 @@
"MMM d HH:mm:ss",
"MMM dd HH:mm:ss"
],
{< if .convert_timezone >}"timezone": "{{ event.timezone }}",{< end >}
"ignore_failure": true
}
},
{
"date": {
"if": "ctx.event.timezone != null",
"field": "@timestamp",
"formats": ["ISO8601"],
"timezone": "{{ event.timezone }}",
"on_failure": [{"append": {"field": "error.message", "value": "{{ _ingest.on_failure_message }}"}}]
}
},
{
"remove": {
"field": "system.auth.timestamp"
Expand Down
9 changes: 6 additions & 3 deletions x-pack/filebeat/module/cisco/asa/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ processors:
- date:
field: "_temp_.raw_date"
ignore_failure: true
{< if .convert_timezone >}
timezone: "{{ event.timezone }}"
{< end >}
formats:
- "MMM d HH:mm:ss"
- "MMM dd HH:mm:ss"
Expand All @@ -42,6 +39,12 @@ processors:
- "MMM dd yyyy HH:mm:ss z"
- "EEE MMM d yyyy HH:mm:ss z"
- "EEE MMM dd yyyy HH:mm:ss z"
- date:
if: "ctx.event.timezone != null"
field: "@timestamp"
formats: ["ISO8601"]
timezone: "{{ event.timezone }}"
on_failure: [{"append": {"field": "error.message", "value": "{{ _ingest.on_failure_message }}"}}]

#
# Set log.level
Expand Down
10 changes: 9 additions & 1 deletion x-pack/filebeat/module/iptables/log/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,21 @@
"date": {
"field": "iptables.raw_date",
"ignore_failure": true,
{< if .convert_timezone >}"timezone": "{{ event.timezone }}",{< end >}
"formats": [
"MMM d HH:mm:ss",
"MMM dd HH:mm:ss"
]
}
},
{
"date": {
"if": "ctx.event.timezone != null",
"field": "@timestamp",
"formats": ["ISO8601"],
"timezone": "{{ event.timezone }}",
"on_failure": [{"append": {"field": "error.message", "value": "{{ _ingest.on_failure_message }}"}}]
}
},
{
"remove": {
"field": "iptables.raw_date",
Expand Down
29 changes: 20 additions & 9 deletions x-pack/filebeat/module/panw/panos/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,44 @@ processors:
- date:
field: "_temp_.generated_time"
ignore_failure: true
#{< if .convert_timezone >}
timezone: "{{ event.timezone }}"
#{< end >}
formats:
- "yyyy/MM/dd HH:mm:ss"
- date:
if: "ctx.event.timezone != null"
field: "@timestamp"
formats: ["ISO8601"]
timezone: "{{ event.timezone }}"
on_failure: [{"append": {"field": "error.message", "value": "{{ _ingest.on_failure_message }}"}}]

# event.created is the time the event was received at the management plane.
- date:
field: "event.created"
target_field: "event.created"
ignore_failure: true
#{< if .convert_timezone >}
timezone: "{{ event.timezone }}"
#{< end >}
formats:
- "yyyy/MM/dd HH:mm:ss"
- date:
if: "ctx.event.timezone != null && ctx.event.created != null "
field: "event.created"
target_field: "event.created"
formats: ["ISO8601"]
timezone: "{{ event.timezone }}"
on_failure: [{"append": {"field": "error.message", "value": "{{ _ingest.on_failure_message }}"}}]

# event.start (traffic only) is the time the session started.
- date:
field: "event.start"
target_field: "event.start"
ignore_failure: true
#{< if .convert_timezone >}
timezone: "{{ event.timezone }}"
#{< end >}
formats:
- "yyyy/MM/dd HH:mm:ss"
- date:
if: "ctx.event.timezone != null && ctx.event.start != null"
field: "event.start"
target_field: "event.start"
formats: ["ISO8601"]
timezone: "{{ event.timezone }}"
on_failure: [{"append": {"field": "error.message", "value": "{{ _ingest.on_failure_message }}"}}]

# convert integer fields as the output of the CSV processor is always a string.
- convert: { type: long, ignore_missing: true, field: client.bytes }
Expand Down
8 changes: 5 additions & 3 deletions x-pack/filebeat/module/rabbitmq/log/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ processors:
formats:
- yy-MM-dd HH:mm:ss.SSS
ignore_failure: true
#{< if .convert_timezone >}
- date:
if: "ctx.event.timezone != null"
field: "@timestamp"
formats: ["ISO8601"]
timezone: "{{ event.timezone }}"
#{< end >}
- remove:
field:
- timestamp
on_failure:
- set:
field: error.message
value: "{{ _ingest.on_failure_message }}"
value: "{{ _ingest.on_failure_message }}"