-
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
Add PostgresSQL module for Filebeat #4763
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,43 @@ | ||
//// | ||
This file is generated! See scripts/docs_collector.py | ||
//// | ||
|
||
[[filebeat-module-postgresql]] | ||
== PostgreSQL module | ||
|
||
This module collects and parses the logs created by https://www.postgresql.org/[PostgreSQL]. | ||
|
||
[float] | ||
=== Compatibility | ||
|
||
The PostgreSQL module was tested with logs from versions 9.5 on Ubuntu and 9.6 on Debian. | ||
|
||
[float] | ||
=== Dashboard | ||
|
||
This module comes with two sample dashboards. | ||
|
||
The first dashboard is for regulars logs. | ||
|
||
image::./images/filebeat-postgresql-overview.png[] | ||
|
||
The second one shows the slowlogs of PostgreSQL. | ||
|
||
image::./images/filebeat-postgresql-postgresql-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-postgresql,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,12 @@ | ||
#- module: postgresql | ||
# Logs | ||
#log: | ||
#enabled: true | ||
|
||
# Set custom paths for the log files. If left empty, | ||
# Filebeat will choose the paths depending on your OS. | ||
#var.paths: | ||
|
||
# Prospector configuration (advanced). Any prospector configuration option | ||
# can be added under this section. | ||
#prospector: |
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,8 @@ | ||
- module: postgresql | ||
# All logs | ||
log: | ||
enabled: true | ||
|
||
# Set custom paths for the log files. If left empty, | ||
# Filebeat will choose the paths depending on your OS. | ||
#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,30 @@ | ||
== PostgreSQL module | ||
|
||
This module collects and parses the logs created by https://www.postgresql.org/[PostgreSQL]. | ||
|
||
[float] | ||
=== Compatibility | ||
|
||
The PostgreSQL module was tested with logs from versions 9.5 on Ubuntu and 9.6 on Debian. | ||
|
||
[float] | ||
=== Dashboard | ||
|
||
This module comes with two sample dashboards. | ||
|
||
The first dashboard is for regulars logs. | ||
|
||
image::./images/filebeat-postgresql-overview.png[] | ||
|
||
The second one shows the slowlogs of PostgreSQL. | ||
|
||
image::./images/filebeat-postgresql-postgresql-overview.png[] | ||
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. it should be |
||
|
||
[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,11 @@ | ||
- key: postgresql | ||
title: "PostgreSQL" | ||
description: > | ||
Module for parsing the PostgreSQL log files. | ||
short_config: true | ||
fields: | ||
- name: postgresql | ||
type: group | ||
description: > | ||
Fields from PostgreSQL logs. | ||
fields: |
64 changes: 64 additions & 0 deletions
64
filebeat/module/postgresql/_meta/kibana/default/dashboard/Filebeat-Postgresql-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,64 @@ | ||
{ | ||
"objects": [ | ||
{ | ||
"attributes": { | ||
"description": "", | ||
"kibanaSavedObjectMeta": { | ||
"searchSourceJSON": "{\"filter\":[]}" | ||
}, | ||
"savedSearchId": "ef9da9b0-776c-11e7-9e03-393c0d1aa325", | ||
"title": "PostgreSQL Log Level Count", | ||
"uiStateJSON": "{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}}", | ||
"version": 1, | ||
"visState": "{\"title\":\"PostgreSQL Log Level Count\",\"type\":\"table\",\"params\":{\"perPage\":10,\"showPartialRows\":false,\"showMeticsAtAllLevels\":false,\"sort\":{\"columnIndex\":null,\"direction\":null},\"showTotal\":false,\"totalFunc\":\"sum\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"bucket\",\"params\":{\"field\":\"postgresql.log.level\",\"size\":12,\"order\":\"desc\",\"orderBy\":\"1\"}}]}" | ||
}, | ||
"id": "28563b50-776d-11e7-9e03-393c0d1aa325", | ||
"type": "visualization", | ||
"version": 1 | ||
}, | ||
{ | ||
"attributes": { | ||
"columns": [ | ||
"postgresql.log.user", | ||
"postgresql.log.database", | ||
"postgresql.log.level", | ||
"postgresql.log.message", | ||
"postgresql.log.query" | ||
], | ||
"description": "", | ||
"hits": 0, | ||
"kibanaSavedObjectMeta": { | ||
"searchSourceJSON": "{\"index\":\"a0b887a0-763d-11e7-9e03-393c0d1aa325\",\"highlightAll\":true,\"version\":true,\"query\":{\"query\":\"postgresql.log.level:*\",\"language\":\"lucene\"},\"filter\":[]}" | ||
}, | ||
"sort": [ | ||
"@timestamp", | ||
"desc" | ||
], | ||
"title": "PostgreSQL All Logs", | ||
"version": 1 | ||
}, | ||
"id": "ef9da9b0-776c-11e7-9e03-393c0d1aa325", | ||
"type": "search", | ||
"version": 1 | ||
}, | ||
{ | ||
"attributes": { | ||
"description": "", | ||
"hits": 0, | ||
"kibanaSavedObjectMeta": { | ||
"searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[],\"highlightAll\":true,\"version\":true}" | ||
}, | ||
"optionsJSON": "{\"darkTheme\":false}", | ||
"panelsJSON": "[{\"size_x\":6,\"size_y\":3,\"panelIndex\":1,\"type\":\"visualization\",\"id\":\"28563b50-776d-11e7-9e03-393c0d1aa325\",\"col\":1,\"row\":4},{\"size_x\":12,\"size_y\":3,\"panelIndex\":2,\"type\":\"search\",\"id\":\"ef9da9b0-776c-11e7-9e03-393c0d1aa325\",\"col\":1,\"row\":1,\"columns\":[\"postgresql.log.user\",\"postgresql.log.database\",\"postgresql.log.level\",\"postgresql.log.message\",\"postgresql.log.query\"],\"sort\":[\"@timestamp\",\"desc\"]}]", | ||
"timeRestore": false, | ||
"title": "PostgreSQL All Logs", | ||
"uiStateJSON": "{\"P-1\":{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}}}", | ||
"version": 1 | ||
}, | ||
"id": "a21284c0-776e-11e7-9e03-393c0d1aa325", | ||
"type": "dashboard", | ||
"version": 1 | ||
} | ||
], | ||
"version": "6.0.0-beta1-SNAPSHOT" | ||
} |
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.
it should be
images/filebeat-postgresql-slowlog-overview.png
I thinkThere 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.
Should be fixed with: #4843