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

Cherry-pick 10033 to 6.x: Add grok pattern to support different timestamp fmt in redis log #10056

Merged
merged 3 commits into from
Jan 16, 2019
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.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ https://github.com/elastic/beats/compare/v6.6.0...6.x[Check the HEAD diff]

- Allow beats to blacklist certain part of the configuration while using Central Management. {pull}9099[9099]
- Filesets with multiple ingest pipelines added in {pull}8914[8914] only work with Elasticsearch >= 6.5.0 {pull}10001[10001]
- Add grok pattern to support redis 5.0.3 log timestamp. {issue}9819[9819] {pull}10033[10033]

*Heartbeat*

Expand Down
7 changes: 5 additions & 2 deletions filebeat/module/redis/log/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
"grok": {
"field": "message",
"patterns": [
"(%{POSINT:redis.log.pid:long}:%{CHAR:redis.log.role} )?%{REDISTIMESTAMP:redis.log.timestamp} %{REDISLEVEL:redis.log.level} %{GREEDYDATA:redis.log.message}",
"(%{POSINT:redis.log.pid:long}:%{CHAR:redis.log.role} )?(%{REDISTIMESTAMP1:redis.log.timestamp}||%{REDISTIMESTAMP2:redis.log.timestamp}) %{REDISLEVEL:redis.log.level} %{GREEDYDATA:redis.log.message}",
"%{POSINT:redis.log.pid:long}:signal-handler \\(%{POSINT:redis.log.timestamp}\\) %{GREEDYDATA:redis.log.message}"
],
"pattern_definitions": {
"CHAR": "[a-zA-Z]",
"REDISLEVEL": "[.\\-*#]"
"REDISLEVEL": "[.\\-*#]",
"REDISTIMESTAMP1": "%{MONTHDAY} %{MONTH} %{TIME}",
"REDISTIMESTAMP2": "%{MONTHDAY} %{MONTH} %{YEAR} %{TIME}"
}
}
},
Expand Down Expand Up @@ -62,6 +64,7 @@
"field": "redis.log.timestamp",
"target_field": "@timestamp",
"formats": [
"dd MMM YYYY H:m:s.SSS",
"dd MMM H:m:s.SSS",
"dd MMM H:m:s",
"UNIX"
Expand Down
1 change: 1 addition & 0 deletions filebeat/module/redis/log/test/redis-5.0.3.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
26571:M 27 Dec 2018 11:19:18.874 * Synchronization with replica 10.114.208.18:6023 succeeded
14 changes: 14 additions & 0 deletions filebeat/module/redis/log/test/redis-5.0.3.log-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"event.dataset": "redis.log",
"fileset.module": "redis",
"fileset.name": "log",
"input.type": "log",
"offset": 0,
"prospector.type": "log",
"redis.log.level": "notice",
"redis.log.message": "Synchronization with replica 10.114.208.18:6023 succeeded",
"redis.log.pid": "26571",
"redis.log.role": "master"
}
]