-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Teach elasticsearch/slowlog fileset to parse more fields #11939
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
Merged
ycombinator
merged 8 commits into
elastic:master
from
ycombinator:fb-es-slowlog-structured-new-fields
Jul 15, 2019
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
464272b
Teach elasticsearch/slowlog to parse more fields
ycombinator 682ec54
No need for new took_millis field
ycombinator d622629
Adding new indexing slow logs
ycombinator 93d65f5
Adding source field
ycombinator a1d20c6
Adding CHANGELOG entry
ycombinator 5c16bdd
Adding indexing slowlog test files
ycombinator 5dc6fe9
Adding more samples based on latest updates to ES PR
ycombinator 483242b
Renaming files to accurately reflect version
ycombinator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
filebeat/module/elasticsearch/slowlog/test/es74_index_indexing_slowlog-json.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{"type": "index_indexing_slowlog", "timestamp": "2019-06-24T15:01:11,415-04:00", "level": "WARN", "component": "i.i.s.index", "cluster.name": "esprod", "node.name": "esprod0", "message": "[foo/6cpavWDYRO6pyxezB0LepA]", "took": "3ms", "took_millis": "3", "doc_type": "t", "id": "1", "routing": "", "source": "{\"foo\":\"bar\"}", "cluster.uuid": "b28RGuVmRDimbAkNTVbacg", "node.id": "erxPlzmKQOGUdrDxGrww_g" } | ||
{"type": "index_indexing_slowlog", "timestamp": "2019-07-09T04:48:28,203-04:00", "level": "WARN", "component": "i.i.s.index", "cluster.name": "es1", "node.name": "es1_1", "message": "[foo/DubP3paOQJCtD1EkUmqxpw]", "took": "2.3ms", "took_millis": "2", "doc_type": "_doc", "id": "1", "source": "{\"foo\":\"bar\"}", "cluster.uuid": "xOp8Gs9TTa-SoSWcs6NZHg", "node.id": "BgSzU7SUTgeRYqzbiyf1sA" } |
51 changes: 51 additions & 0 deletions
51
...beat/module/elasticsearch/slowlog/test/es74_index_indexing_slowlog-json.log-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
[ | ||
{ | ||
"@timestamp": "2019-06-24T19:01:11.415Z", | ||
"elasticsearch.cluster.name": "esprod", | ||
"elasticsearch.cluster.uuid": "b28RGuVmRDimbAkNTVbacg", | ||
"elasticsearch.component": "i.i.s.index", | ||
"elasticsearch.index.id": "6cpavWDYRO6pyxezB0LepA", | ||
"elasticsearch.index.name": "foo", | ||
"elasticsearch.node.id": "erxPlzmKQOGUdrDxGrww_g", | ||
"elasticsearch.node.name": "esprod0", | ||
"elasticsearch.slowlog.id": "1", | ||
"elasticsearch.slowlog.routing": "", | ||
"elasticsearch.slowlog.source": "{\"foo\":\"bar\"}", | ||
"elasticsearch.slowlog.took": "3ms", | ||
"elasticsearch.slowlog.types": "t", | ||
"event.dataset": "elasticsearch.slowlog", | ||
"event.duration": 3000000, | ||
"event.module": "elasticsearch", | ||
"event.timezone": "+00:00", | ||
"fileset.name": "slowlog", | ||
"input.type": "log", | ||
"log.level": "WARN", | ||
"log.offset": 0, | ||
"message": "{\"type\": \"index_indexing_slowlog\", \"timestamp\": \"2019-06-24T15:01:11,415-04:00\", \"level\": \"WARN\", \"component\": \"i.i.s.index\", \"cluster.name\": \"esprod\", \"node.name\": \"esprod0\", \"message\": \"[foo/6cpavWDYRO6pyxezB0LepA]\", \"took\": \"3ms\", \"took_millis\": \"3\", \"doc_type\": \"t\", \"id\": \"1\", \"routing\": \"\", \"source\": \"{\\\"foo\\\":\\\"bar\\\"}\", \"cluster.uuid\": \"b28RGuVmRDimbAkNTVbacg\", \"node.id\": \"erxPlzmKQOGUdrDxGrww_g\" }", | ||
"service.type": "elasticsearch" | ||
}, | ||
{ | ||
"@timestamp": "2019-07-09T08:48:28.203Z", | ||
"elasticsearch.cluster.name": "es1", | ||
"elasticsearch.cluster.uuid": "xOp8Gs9TTa-SoSWcs6NZHg", | ||
"elasticsearch.component": "i.i.s.index", | ||
"elasticsearch.index.id": "DubP3paOQJCtD1EkUmqxpw", | ||
"elasticsearch.index.name": "foo", | ||
"elasticsearch.node.id": "BgSzU7SUTgeRYqzbiyf1sA", | ||
"elasticsearch.node.name": "es1_1", | ||
"elasticsearch.slowlog.id": "1", | ||
"elasticsearch.slowlog.source": "{\"foo\":\"bar\"}", | ||
"elasticsearch.slowlog.took": "2.3ms", | ||
"elasticsearch.slowlog.types": "_doc", | ||
"event.dataset": "elasticsearch.slowlog", | ||
"event.duration": 2000000, | ||
"event.module": "elasticsearch", | ||
"event.timezone": "+00:00", | ||
"fileset.name": "slowlog", | ||
"input.type": "log", | ||
"log.level": "WARN", | ||
"log.offset": 409, | ||
"message": "{\"type\": \"index_indexing_slowlog\", \"timestamp\": \"2019-07-09T04:48:28,203-04:00\", \"level\": \"WARN\", \"component\": \"i.i.s.index\", \"cluster.name\": \"es1\", \"node.name\": \"es1_1\", \"message\": \"[foo/DubP3paOQJCtD1EkUmqxpw]\", \"took\": \"2.3ms\", \"took_millis\": \"2\", \"doc_type\": \"_doc\", \"id\": \"1\", \"source\": \"{\\\"foo\\\":\\\"bar\\\"}\", \"cluster.uuid\": \"xOp8Gs9TTa-SoSWcs6NZHg\", \"node.id\": \"BgSzU7SUTgeRYqzbiyf1sA\" }", | ||
"service.type": "elasticsearch" | ||
} | ||
] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this going to work if we remove that field in 8? (I have remove that so possibly there this probably will be empty/missing). I forgot about that in my PR, fixing now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should be okay because of the
ignore_missing
flag set on this processor (see a couple lines below). In 9 we can completely remove this processor from the pipeline as, by then we won't expect to see any log lines withdoc_type
in them.