forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
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 SQL responses in key/value format (elastic#15845)
There are some queries like mysql `SHOW STATUS` that display the results in a key/value format so they need to be scanned in a different way, being the key the first column of the response and the value the second one.
- Loading branch information
1 parent
89822fe
commit d8517c6
Showing
13 changed files
with
1,479 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
|
||
driver: "postgres" | ||
sql_query: "select now()" | ||
|
||
sql_response_format: table |
Large diffs are not rendered by default.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
x-pack/metricbeat/module/sql/query/_meta/data_mysql_tables.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,30 @@ | ||
{ | ||
"@timestamp": "2017-10-12T08:05:34.853Z", | ||
"event": { | ||
"dataset": "sql.query", | ||
"duration": 115000, | ||
"module": "sql" | ||
}, | ||
"metricset": { | ||
"name": "query", | ||
"period": 10000 | ||
}, | ||
"service": { | ||
"address": "172.21.0.2:3306", | ||
"type": "sql" | ||
}, | ||
"sql": { | ||
"driver": "mysql", | ||
"metrics": { | ||
"numeric": { | ||
"table_rows": 1 | ||
}, | ||
"string": { | ||
"engine": "MyISAM", | ||
"table_name": "db", | ||
"table_schema": "mysql" | ||
} | ||
}, | ||
"query": "select table_schema, table_name, engine, table_rows from information_schema.tables where table_rows \u003e 0;" | ||
} | ||
} |
Oops, something went wrong.