-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
New Filebeat module: Kafka logs #4885
Merged
Merged
Changes from all commits
Commits
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,37 @@ | ||
//// | ||
This file is generated! See scripts/docs_collector.py | ||
//// | ||
|
||
[[filebeat-module-kafka]] | ||
== Kafka module | ||
|
||
This module collects and parses the logs created by https://kafka.apache.org/[Kafka]. | ||
|
||
[float] | ||
=== Compatibility | ||
|
||
The Kafka module was tested with logs from versions 2.11. | ||
|
||
[float] | ||
=== Dashboard | ||
|
||
This module comes with a sample dashboard to see Kafka logs and stacktraces. | ||
|
||
image::./images/filebeat-kafka-logs-overview.png[] | ||
|
||
[float] | ||
=== Logs fileset settings | ||
|
||
[float] | ||
==== var.paths | ||
|
||
An array of paths where to look for the log files. If left empty, Filebeat | ||
will choose the paths depending on your operating systems. | ||
|
||
|
||
[float] | ||
=== Fields | ||
|
||
For a description of each field in the metricset, see the | ||
<<exported-fields-kafka,exported fields>> section. | ||
|
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
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,13 @@ | ||
- module: kafka | ||
# All logs | ||
log: | ||
enabled: true | ||
|
||
# Set custom paths for Kafka. If left empty, | ||
# Filebeat will look under /opt. | ||
#var.kafka_home: | ||
|
||
# Set custom paths for the log files. If left empty, | ||
# Filebeat will choose the paths depending on your OS. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment is out-of-date now, I think. It should say it chooses the paths based on the |
||
#var.paths: | ||
|
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,24 @@ | ||
== Kafka module | ||
|
||
This module collects and parses the logs created by https://kafka.apache.org/[Kafka]. | ||
|
||
[float] | ||
=== Compatibility | ||
|
||
The Kafka module was tested with logs from versions 2.11. | ||
|
||
[float] | ||
=== Dashboard | ||
|
||
This module comes with a sample dashboard to see Kafka logs and stacktraces. | ||
|
||
image::./images/filebeat-kafka-logs-overview.png[] | ||
|
||
[float] | ||
=== Logs fileset settings | ||
|
||
[float] | ||
==== var.paths | ||
|
||
An array of paths where to look for the log files. If left empty, Filebeat | ||
will choose the paths depending on your operating systems. |
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,9 @@ | ||
- key: kafka | ||
title: "Kafka" | ||
description: > | ||
Kafka module | ||
fields: | ||
- name: kafka | ||
type: group | ||
description: > | ||
fields: |
85 changes: 85 additions & 0 deletions
85
filebeat/module/kafka/_meta/kibana/default/dashboard/Filebeat-Kafka-overview.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,85 @@ | ||
{ | ||
"objects": [ | ||
{ | ||
"attributes": { | ||
"description": "", | ||
"kibanaSavedObjectMeta": { | ||
"searchSourceJSON": "{\"filter\":[]}" | ||
}, | ||
"savedSearchId": "Kafka stacktraces", | ||
"title": "Number of Kafka stracktraces by class", | ||
"uiStateJSON": "{}", | ||
"version": 1, | ||
"visState": "{\"title\":\"Number of Kafka stracktraces by class\",\"type\":\"histogram\",\"params\":{\"type\":\"histogram\",\"grid\":{\"categoryLines\":false,\"style\":{\"color\":\"#eee\"}},\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"type\":\"category\",\"position\":\"bottom\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\"},\"labels\":{\"show\":true,\"truncate\":100},\"title\":{\"text\":\"@timestamp per 30 minutes\"}}],\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"name\":\"LeftAxis-1\",\"type\":\"value\",\"position\":\"left\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\",\"mode\":\"normal\"},\"labels\":{\"show\":true,\"rotate\":0,\"filter\":false,\"truncate\":100},\"title\":{\"text\":\"Count\"}}],\"seriesParams\":[{\"show\":\"true\",\"type\":\"histogram\",\"mode\":\"stacked\",\"data\":{\"label\":\"Count\",\"id\":\"1\"},\"valueAxis\":\"ValueAxis-1\",\"drawLinesBetweenPoints\":true,\"showCircles\":true}],\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"times\":[],\"addTimeMarker\":false},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"@timestamp\",\"interval\":\"auto\",\"customInterval\":\"2h\",\"min_doc_count\":1,\"extended_bounds\":{}}},{\"id\":\"3\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"group\",\"params\":{\"field\":\"kafka.log.trace.class\",\"size\":10,\"order\":\"desc\",\"orderBy\":\"1\"}}]}" | ||
}, | ||
"id": "Number of Kafka stracktraces by class", | ||
"type": "visualization", | ||
"version": 1 | ||
}, | ||
{ | ||
"attributes": { | ||
"columns": [ | ||
"kafka.log.class", | ||
"kafka.log.trace.class", | ||
"kafka.log.trace.full" | ||
], | ||
"description": "", | ||
"hits": 0, | ||
"kibanaSavedObjectMeta": { | ||
"searchSourceJSON": "{\"index\":\"filebeat-*\",\"highlightAll\":true,\"version\":true,\"query\":{\"query\":\"_exists_:kafka.log.trace.class\",\"language\":\"lucene\"},\"filter\":[]}" | ||
}, | ||
"sort": [ | ||
"@timestamp", | ||
"desc" | ||
], | ||
"title": "Kafka stacktraces", | ||
"version": 1 | ||
}, | ||
"id": "Kafka stacktraces", | ||
"type": "search", | ||
"version": 1 | ||
}, | ||
{ | ||
"attributes": { | ||
"columns": [ | ||
"kafka.log.level", | ||
"kafka.log.component", | ||
"kafka.log.message" | ||
], | ||
"description": "", | ||
"hits": 0, | ||
"kibanaSavedObjectMeta": { | ||
"searchSourceJSON": "{\"index\":\"filebeat-*\",\"highlightAll\":true,\"version\":true,\"query\":{\"query\":\"kafka.log.level:*\",\"language\":\"lucene\"},\"filter\":[]}" | ||
}, | ||
"sort": [ | ||
"@timestamp", | ||
"desc" | ||
], | ||
"title": "All Kafka logs", | ||
"version": 1 | ||
}, | ||
"id": "All Kafka logs", | ||
"type": "search", | ||
"version": 1 | ||
}, | ||
{ | ||
"attributes": { | ||
"description": "", | ||
"hits": 0, | ||
"kibanaSavedObjectMeta": { | ||
"searchSourceJSON": "{\"query\":{\"language\":\"lucene\",\"query\":\"\"},\"filter\":[],\"highlightAll\":true,\"version\":true}" | ||
}, | ||
"optionsJSON": "{\"darkTheme\":false}", | ||
"panelsJSON": "[{\"col\":1,\"id\":\"Number of Kafka stracktraces by class\",\"panelIndex\":1,\"row\":1,\"size_x\":6,\"size_y\":3,\"type\":\"visualization\"},{\"col\":7,\"columns\":[\"kafka.log.class\",\"kafka.log.trace.class\",\"kafka.log.trace.full\"],\"id\":\"Kafka stacktraces\",\"panelIndex\":2,\"row\":1,\"size_x\":6,\"size_y\":3,\"sort\":[\"@timestamp\",\"desc\"],\"type\":\"search\"},{\"size_x\":12,\"size_y\":3,\"panelIndex\":3,\"type\":\"search\",\"id\":\"All Kafka logs\",\"col\":1,\"row\":4,\"columns\":[\"kafka.log.level\",\"kafka.log.component\",\"kafka.log.message\"],\"sort\":[\"@timestamp\",\"desc\"]}]", | ||
"timeRestore": false, | ||
"title": "Kafka logs overview", | ||
"uiStateJSON": "{}", | ||
"version": 1 | ||
}, | ||
"id": "Kafka logs overview", | ||
"type": "dashboard", | ||
"version": 1 | ||
} | ||
], | ||
"version": "6.0.0-beta1-SNAPSHOT" | ||
} |
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,41 @@ | ||
- name: log | ||
type: group | ||
description: > | ||
Kafka log lines. | ||
fields: | ||
- name: timestamp | ||
description: > | ||
The timestamp from the log line. | ||
- name: level | ||
example: "WARN" | ||
description: > | ||
The log level. | ||
- name: message | ||
type: text | ||
description: > | ||
The logged message. | ||
- name: component | ||
type: keyword | ||
description: > | ||
Component the log is coming from. | ||
- name: class | ||
type: text | ||
description: > | ||
Java class the log is coming from. | ||
- name: trace | ||
type: group | ||
description: > | ||
Trace in the log line. | ||
fields: | ||
- name: class | ||
type: keyword | ||
description: > | ||
Java class the trace is coming from. | ||
- name: message | ||
type: text | ||
description: > | ||
Message part of the trace. | ||
- name: full | ||
type: text | ||
description: > | ||
The full trace in the log line. |
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,10 @@ | ||
type: log | ||
paths: | ||
{{ range $i, $path := .paths }} | ||
- {{$path}} | ||
{{ end }} | ||
exclude_files: [".gz$"] | ||
multiline: | ||
pattern: '^\[' | ||
negate: true | ||
match: after |
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.
I think we can put the default in the commented line here, so it's clear for the user how to edit. I.e.:
Btw, it's
/opt/kafka*
, not just/opt
, right?