Skip to content

Commit

Permalink
[Filebeat] Add timezone information in apache error fileset (#13304)
Browse files Browse the repository at this point in the history
* Add timezone information in Apache Error metricset
  • Loading branch information
kaiyan-sheng authored Aug 26, 2019
1 parent 3e34fb6 commit f21aaa6
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Allow path variables to be used in files loaded from modules.d. {issue}13184[13184]
- Fix incorrect references to index patterns in AWS and CoreDNS dashboards. {pull}13303[13303]
- Change iis url.path grok pattern from URIPATH to NOTSPACE. {issue}12710[12710] {pull}13225[13225]
- Add timezone information to apache error fileset. {issue}12772[12772] {pull}13304[13304]

*Heartbeat*

Expand Down
2 changes: 2 additions & 0 deletions filebeat/docs/modules/apache.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ include::../include/var-paths.asciidoc[]

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

include::../include/timezone-support.asciidoc[]

:has-dashboards!:

:fileset_ex!:
Expand Down
2 changes: 2 additions & 0 deletions filebeat/module/apache/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ include::../include/var-paths.asciidoc[]

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

include::../include/timezone-support.asciidoc[]

:has-dashboards!:

:fileset_ex!:
Expand Down
3 changes: 3 additions & 0 deletions filebeat/module/apache/error/config/error.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ paths:
- {{$path}}
{{ end }}
exclude_files: [".gz$"]

processors:
- add_locale: ~
20 changes: 20 additions & 0 deletions filebeat/module/apache/error/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@
"ignore_failure": true
}
},
{
"date": {
"if": "ctx.event.timezone != null",
"field": "apache.error.timestamp",
"target_field": "@timestamp",
"formats": [
"EEE MMM dd H:m:s yyyy",
"EEE MMM dd H:m:s.SSSSSS yyyy"
],
"timezone": "{{ event.timezone }}",
"on_failure": [
{
"append": {
"field": "error.message",
"value": "{{ _ingest.on_failure_message }}"
}
}
]
}
},
{
"remove": {
"field": "apache.error.timestamp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"apache.error.module": "mpm_prefork",
"event.dataset": "apache.error",
"event.module": "apache",
"event.timezone": "+00:00",
"fileset.name": "error",
"input.type": "log",
"log.level": "notice",
Expand All @@ -17,6 +18,7 @@
"apache.error.module": "core",
"event.dataset": "apache.error",
"event.module": "apache",
"event.timezone": "+00:00",
"fileset.name": "error",
"input.type": "log",
"log.level": "notice",
Expand Down
4 changes: 4 additions & 0 deletions filebeat/module/apache/error/test/test.log-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"@timestamp": "2016-12-26T16:22:08.000Z",
"event.dataset": "apache.error",
"event.module": "apache",
"event.timezone": "+00:00",
"fileset.name": "error",
"input.type": "log",
"log.level": "error",
Expand All @@ -17,6 +18,7 @@
"apache.error.module": "core",
"event.dataset": "apache.error",
"event.module": "apache",
"event.timezone": "+00:00",
"fileset.name": "error",
"input.type": "log",
"log.level": "notice",
Expand All @@ -30,6 +32,7 @@
"apache.error.module": "core",
"event.dataset": "apache.error",
"event.module": "apache",
"event.timezone": "+00:00",
"fileset.name": "error",
"input.type": "log",
"log.level": "error",
Expand All @@ -55,6 +58,7 @@
"apache.error.module": "include",
"event.dataset": "apache.error",
"event.module": "apache",
"event.timezone": "+00:00",
"fileset.name": "error",
"input.type": "log",
"log.level": "warn",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"@timestamp": "2016-12-26T16:17:53.000Z",
"event.dataset": "apache.error",
"event.module": "apache",
"event.timezone": "+00:00",
"fileset.name": "error",
"input.type": "log",
"log.level": "notice",
Expand All @@ -14,6 +15,7 @@
"@timestamp": "2016-12-26T16:22:00.000Z",
"event.dataset": "apache.error",
"event.module": "apache",
"event.timezone": "+00:00",
"fileset.name": "error",
"input.type": "log",
"log.level": "error",
Expand All @@ -27,6 +29,7 @@
"@timestamp": "2016-12-26T16:22:08.000Z",
"event.dataset": "apache.error",
"event.module": "apache",
"event.timezone": "+00:00",
"fileset.name": "error",
"input.type": "log",
"log.level": "error",
Expand All @@ -40,6 +43,7 @@
"@timestamp": "2016-12-26T16:22:08.000Z",
"event.dataset": "apache.error",
"event.module": "apache",
"event.timezone": "+00:00",
"fileset.name": "error",
"input.type": "log",
"log.level": "error",
Expand All @@ -53,6 +57,7 @@
"@timestamp": "2016-12-26T16:22:10.000Z",
"event.dataset": "apache.error",
"event.module": "apache",
"event.timezone": "+00:00",
"fileset.name": "error",
"input.type": "log",
"log.level": "error",
Expand All @@ -66,6 +71,7 @@
"@timestamp": "2016-12-26T16:22:13.000Z",
"event.dataset": "apache.error",
"event.module": "apache",
"event.timezone": "+00:00",
"fileset.name": "error",
"input.type": "log",
"log.level": "error",
Expand All @@ -79,6 +85,7 @@
"@timestamp": "2016-12-26T16:22:17.000Z",
"event.dataset": "apache.error",
"event.module": "apache",
"event.timezone": "+00:00",
"fileset.name": "error",
"input.type": "log",
"log.level": "error",
Expand Down

0 comments on commit f21aaa6

Please sign in to comment.