-
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
SQL module now supports key/value mode #15845
SQL module now supports key/value mode #15845
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
1 similar comment
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
CI is failing because I have to format some yaml files. |
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.
@rvillablanca thanks for this contribution, this is looking great!
I have added some comments about small things we should address before merging.
Oh, and please add a changelog entry in |
Ok I'll do all these sugestions as soon as I have time 👍 |
Co-Authored-By: Jaime Soriano Pastor <jaime.soriano@elastic.co>
…a/beats into ft/key-value-mode-sql-module
@jsoriano I'm trying without success to solve the issues with CI about python test but I always get
I have tried to change the python version with Viewing the content of
This is being a bit frustrating 😢 |
@rvillablanca yeah, I am sorry, but tools for Beats development only work with Python 2.7 by now (we expect to change this soon #14798). To solve this, remove this |
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.
This is looking good! Thanks!
That was what I needed, thanks @jsoriano |
Co-Authored-By: Jaime Soriano Pastor <jaime.soriano@elastic.co>
…a/beats into ft/key-value-mode-sql-module
79643c2
to
078fb01
Compare
CI is passing now 🎉 @jsoriano |
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.
LGTM! There is a conflict in data_postgres.json
, could you regenerate this file? Thanks!
ok to test |
File generated |
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.
Ok, I think this is ready to merge, let's wait for a green CI build.
Failure in jenkins is not related, merging. |
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. (cherry picked from commit d8517c6)
…5870) 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. (cherry picked from commit d8517c6) Co-authored-by: Rodrigo Villablanca Vásquez <villa061004@gmail.com>
What does this PR do?
This PR allows to SQL generic module to send events correctly when the query return results in the way of key/values format.
Why is it important?
Because there are some querys 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 of the response.Checklist
How to test this PR locally
Having a mysql database, enable and configure que
sql
module with console as output, variable mode and querySHOW STATUS
.For example
Running
metricbeat -e
you will see only one event with all key/value pairs:This PR introduces a new configuration option called
sql_response_format
with 2 available values:Any other value will exit with an error. The configuration option and their values were suggested in the issue #15770
Related issues