-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for MariaDB in the Filebeat module for MySQL. slowlog grok pattern is modified to support more versions of this log file and to make it easier to support more in the future. More example files are added to test this. Co-authored-by: Rodrigo Floriano de Souza <rodrigochurrops@gmail.com>
- Loading branch information
Showing
14 changed files
with
369 additions
and
7 deletions.
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
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
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,6 @@ | ||
# Time: 180613 11:04:36 | ||
# User@Host: root[root] @ localhost [121.0.0.1] | ||
# Thread_id: 5 Schema: QC_hit: No | ||
# Query_time: 2.000652 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 0 | ||
SET timestamp=1528898676; | ||
select sleep(2); |
28 changes: 28 additions & 0 deletions
28
filebeat/module/mysql/slowlog/test/mariadb-10.1.21.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,28 @@ | ||
[ | ||
{ | ||
"@timestamp": "2018-06-13T14:04:36.000Z", | ||
"ecs.version": "1.0.0-beta2", | ||
"event.dataset": "mysql.slowlog", | ||
"event.duration": 2000652000, | ||
"event.module": "mysql", | ||
"fileset.name": "slowlog", | ||
"input.type": "log", | ||
"log.flags": [ | ||
"multiline" | ||
], | ||
"log.offset": 24, | ||
"mysql.slowlog.current_user": "root", | ||
"mysql.slowlog.id": "5", | ||
"mysql.slowlog.lock_time.sec": 0.0, | ||
"mysql.slowlog.query": "select sleep(2);", | ||
"mysql.slowlog.query_cache_hit": false, | ||
"mysql.slowlog.query_time.sec": 2.000652, | ||
"mysql.slowlog.rows_examined": 0, | ||
"mysql.slowlog.rows_sent": 1, | ||
"mysql.slowlog.timestamp": 1528898676, | ||
"service.type": "mysql", | ||
"source.domain": "localhost", | ||
"source.ip": "121.0.0.1", | ||
"user.name": "root" | ||
} | ||
] |
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,23 @@ | ||
mysqld, Version: 10.2.12-MariaDB-10.2.12+maria~jessie-log (mariadb.org binary distribution). started with: | ||
Tcp port: 0 Unix socket: /var/run/mysqld/mysqld.sock | ||
Time Id Command Argument | ||
mysqld, Version: 10.2.12-MariaDB-10.2.12+maria~jessie-log (mariadb.org binary distribution). started with: | ||
Tcp port: 3306 Unix socket: /var/run/mysqld/mysqld.sock | ||
Time Id Command Argument | ||
# Time: 190117 16:04:03 | ||
# User@Host: root[root] @ localhost [] | ||
# Thread_id: 8 Schema: QC_hit: No | ||
# Query_time: 2.000227 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 0 | ||
# Rows_affected: 0 | ||
SET timestamp=1547741043; | ||
select sleep(2) | ||
AS foo; | ||
# Time: 190117 16:04:18 | ||
# User@Host: root[root] @ [192.168.0.10] | ||
# Thread_id: 25844 Schema: blah QC_hit: No | ||
# Query_time: 178.306017 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 53022772 | ||
# Rows_affected: 3062 | ||
# Full_scan: Yes Full_join: No Tmp_table: Yes Tmp_table_on_disk: No | ||
# Filesort: Yes Filesort_on_disk: No Merge_passes: 0 Priority_queue: No | ||
SET timestamp=1547741058; | ||
call PROC('blah'); |
Oops, something went wrong.