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. |
jsoriano
left a comment
There was a problem hiding this comment.
@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 |
jsoriano
left a comment
There was a problem hiding this comment.
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 |
|
ok to test |
|
File generated |
jsoriano
left a comment
There was a problem hiding this comment.
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 STATUSthat 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
sqlmodule with console as output, variable mode and querySHOW STATUS.For example
Running
metricbeat -eyou will see only one event with all key/value pairs:This PR introduces a new configuration option called
sql_response_formatwith 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