Skip to content

Commit

Permalink
Add jvm9 logging format to GC fileset of ES module (#7390)
Browse files Browse the repository at this point in the history
  • Loading branch information
immon authored and ruflin committed Jun 21, 2018
1 parent 0576fe6 commit 61c7203
Show file tree
Hide file tree
Showing 9 changed files with 5,361 additions and 13 deletions.
22 changes: 21 additions & 1 deletion filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ elasticsearch Module
--
type: float
Garbage collection threads total stop time seconds.
The time from JVM start up in seconds, as a floating point number.
--
Expand All @@ -834,6 +834,26 @@ type: float
Time took to stop threads seconds.
--
*`elasticsearch.gc.pid`*::
+
--
type: long
The PID of JVM process.
--
*`elasticsearch.gc.tags`*::
+
--
type: keyword
GC logging tags.
--
[float]
Expand Down
2 changes: 1 addition & 1 deletion filebeat/include/fields.go

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion filebeat/module/elasticsearch/gc/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- name: relative_process_timestamp_secs
type: float
description: >
Garbage collection threads total stop time seconds.
The time from JVM start up in seconds, as a floating point number.
- name: threads_total_stop_time_secs
type: float
description: >
Expand All @@ -14,3 +14,11 @@
type: float
description: >
Time took to stop threads seconds.
- name: pid
type: long
description: >
The PID of JVM process.
- name: tags
type: keyword
description: >
GC logging tags.
5 changes: 3 additions & 2 deletions filebeat/module/elasticsearch/gc/config/gc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ paths:
- {{$path}}
{{ end }}
exclude_files: [".gz$"]
exclude_lines: ["^(OpenJDK|Java HotSpot).* Server VM ", "^CommandLine flags: ", "^Memory: "] # exclude JVM8 banner
multiline:
pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}'
pattern: '^\[?[0-9]{4}-[0-9]{2}-[0-9]{2}'
negate: true
match: after

fields:
service.name: "elasticsearch"
fields_under_root: true
fields_under_root: true
29 changes: 22 additions & 7 deletions filebeat/module/elasticsearch/gc/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"grok": {
"field": "message",
"patterns": [
"%{GCTIMESTAMP}: %{GCPROCRUNTIME}: Total time for which application threads were stopped: %{BASE10NUM:elasticsearch.gc.threads_total_stop_time_secs} seconds, Stopping threads took: %{BASE10NUM:elasticsearch.gc.stopping_threads_time_secs} seconds",
"%{GCTIMESTAMP}: %{GREEDYMULTILINE:message}"
"(?:%{JVM8HEADER}|%{JVM9HEADER}) Total time for which application threads were stopped: %{BASE10NUM:elasticsearch.gc.threads_total_stop_time_secs} seconds, Stopping threads took: %{BASE10NUM:elasticsearch.gc.stopping_threads_time_secs} seconds",
"(?:%{JVM8HEADER}|%{JVM9HEADER}) %{GREEDYMULTILINE:message}"
],
"pattern_definitions": {
"GREEDYMULTILINE": "(.|\n)*",
"GCTIMESTAMP": "%{TIMESTAMP_ISO8601:timestamp}",
"GCPROCRUNTIME": "%{BASE10NUM:elasticsearch.gc.relative_process_timestamp_secs}"
"JVM8HEADER": "%{TIMESTAMP_ISO8601:timestamp}: %{BASE10NUM:elasticsearch.gc.relative_process_timestamp_secs}:",
"JVM9HEADER": "\\[%{TIMESTAMP_ISO8601:timestamp}\\]\\[%{POSINT:elasticsearch.gc.pid}\\]\\[%{DATA:elasticsearch.gc.tags}%{SPACE}*\\]"
}
}
},
Expand All @@ -22,9 +22,24 @@
}
},
{
"rename": {
"date": {
"field": "timestamp",
"target_field": "@timestamp"
"target_field": "@timestamp",
"formats": [
"ISO8601"
]
}
},
{
"remove": {
"field": "timestamp"
}
},
{
"split": {
"field": "elasticsearch.gc.tags",
"separator": ",",
"ignore_missing": true
}
}
],
Expand All @@ -36,4 +51,4 @@
}
}
]
}
}
1 change: 1 addition & 0 deletions filebeat/module/elasticsearch/gc/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var:
- name: paths
default:
- /var/log/elasticsearch/gc.log.[0-9]*
- /var/log/elasticsearch/gc.log
os.darwin: []
os.windows: []

Expand Down
4,840 changes: 4,840 additions & 0 deletions filebeat/module/elasticsearch/gc/test/gc.log

Large diffs are not rendered by default.

463 changes: 463 additions & 0 deletions filebeat/module/elasticsearch/gc/test/gc.log.1.current

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"input": {
"type": "log"
},
"@timestamp": "2018-06-11T01:53:11.382+0000",
"@timestamp": "2018-06-11T01:53:11.382Z",
"elasticsearch": {
"gc": {
"stopping_threads_time_secs": "0.0000702",
Expand Down

0 comments on commit 61c7203

Please sign in to comment.