-
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 "key/value" mode for SQL module #15770
Comments
I would like to help in this and doing a little investigation in the code I thing I should make the changes around here
am I right ? 🤔 |
@rvillablanca yes, changes should be done around this I am going to assign this issue to you by now. Ping me if you have a PR to review or any other question. Thanks! |
The only thing I need is to know how I can check the events, do I need kibana or only query elasticsearch ? I have |
@rvillablanca you can also configure your metricbeat with the console output, so it writes the events to the standard output. It'd be also great if you could add a test here with the new setting: https://github.com/elastic/beats/blob/0dab5171f22a5d5e7a2336f8573055b9a889036e/x-pack/metricbeat/module/sql/query/query_integration_test.go These tests can be run with |
I'm done with this @jsoriano 👍 |
SQL generic module currently collects one event per row, being each field the title of the column, and the value the value in the row for this column.
So for a result like this one:
An event containing these fields is generated:
This is a problem for queries that return the values like this:
Because they would generate in this case two events containing fields like these ones:
Enhancement
Add a mode that can be selected with a configuration option and can be used so for the previous example an only event is generated containing fields like this one:
Use case
Some queries, specially some used for monitoring or configuration, use this "key/value" format in responses, for example MySQLs
SHOW STATUS
orSHOW VARIABLES
.This feature would allow to have a configuration like the following one, that would generate a single event mapping each variable to a field:
Would generate a single event per fetch with these fields:
The possible values for
sql_response_format
would be:sql_response_format: table
for current behaviour (default).sql_response_format: variables
for the "key/value" case.The text was updated successfully, but these errors were encountered: