-
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
[BUG] Fix "regular expression has redundant nested repeat operator" in MySQL slowlog module. #17156
Conversation
…MySQL slowlog module. Fix for issue #17086. The grok pattern used in the MySQL slowlog ingest pipeline uses EXPLAIN pattern with a superfluous * wildcard. This makes Elasticsearch log a warning seemingly every time the pipeline is used.
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? |
💚 CLA has been signed |
CLA signed. |
Pinging @elastic/integrations-services (Team:Services) |
Looks like it's the other way around. Didn't realize expanding a pattern adds (?: ) around the pattern. |
Your solution of removing the I've experimented a little bit and found out that this change instead: - "EXPLAIN": "(# explain:.*\n|#\\s*\n)*"
+ "EXPLAIN": "(:?(# explain:.*\n|#\\s*\n)*)" Makes the Elasticsearch error go away and at the same time passes all the tests. Now, I'm not 100% sure this is a good solution and so many regexps is giving me a headache. @jsoriano WDYT? |
I commented before seeing your last commit and comment. The current solution is nicer than what I propose and the tests pass 👍 |
jenkins, test this |
Regex. Love it when it works, hate it when it doesn't. :) |
LGTM! Thanks for dealing with these regular expressions! |
@whataboutpereira this is good to merge. Can you add an entry to the CHANGELOG.next.asciidoc file, at the end of the Bugfixes - Metricbeat section? |
Metricbeat or Filebeat? I added it to Filebeat section for now (since it's a Filebeat module). Let me know if I need to move it to Metricbeat afterall. :) |
Right, my mistake, this is a Filebeat module. I've fixed the changelog conflicts with master and reworded the message a little bit. Hope you don't mind. |
Wonderful, thank you! :) |
…n MySQL slowlog module. (elastic#17156) Fix for issue elastic#17086. The grok pattern used in the MySQL slowlog ingest pipeline uses EXPLAIN pattern with a superfluous * wildcard. This makes Elasticsearch log a warning seemingly every time the pipeline is used. Closes elastic#17086 (cherry picked from commit 58a3ddc)
…n MySQL slowlog module. (elastic#17156) Fix for issue elastic#17086. The grok pattern used in the MySQL slowlog ingest pipeline uses EXPLAIN pattern with a superfluous * wildcard. This makes Elasticsearch log a warning seemingly every time the pipeline is used. Closes elastic#17086 (cherry picked from commit 58a3ddc)
…n MySQL slowlog module. (#17156) (#17394) Fix for issue #17086. The grok pattern used in the MySQL slowlog ingest pipeline uses EXPLAIN pattern with a superfluous * wildcard. This makes Elasticsearch log a warning seemingly every time the pipeline is used. Closes #17086 (cherry picked from commit 58a3ddc) Co-authored-by: Reio Remma <reio@mrstuudio.ee>
…n MySQL slowlog module. (#17156) (#17395) Fix for issue #17086. The grok pattern used in the MySQL slowlog ingest pipeline uses EXPLAIN pattern with a superfluous * wildcard. This makes Elasticsearch log a warning seemingly every time the pipeline is used. Closes #17086 (cherry picked from commit 58a3ddc) Co-authored-by: Reio Remma <reio@mrstuudio.ee>
Hi, thanks for fixing this. I see a label 7.7.0 is added, do you have any idea when this will be available? Or is there a workaround for this issue, because we get a lot of messages in the logs. |
The patch looks scarier than it is, but the actual change was to remove /usr/share/filebeat/module/mysql/slowlog/ingest/pipeline.json Before: |
I just upgraded from 7.4 to 7.6.2 and still having the same error. "regular expression has redundant nested repeat operator" Any update on a fix? |
@anmancipe this fix didn't make it into 7.6.2. It'll be released with 7.7.0. For now you can follow the suggestion in the comment by @whataboutpereira above, edit the pipeline to remove the extra Note that the This is only necessary if you have ever used the elasticsearch or activemq modules. |
I´ve done the following, is this an appropiate approach? PUT /_ingest/pipeline/filebeat-7.6.2-mysql-slowlog-pipeline |
…n MySQL slowlog module. (elastic#17156) (elastic#17395) Fix for issue elastic#17086. The grok pattern used in the MySQL slowlog ingest pipeline uses EXPLAIN pattern with a superfluous * wildcard. This makes Elasticsearch log a warning seemingly every time the pipeline is used. Closes elastic#17086 (cherry picked from commit cbfe82d) Co-authored-by: Reio Remma <reio@mrstuudio.ee>
What does this PR do?
Remove a superfluous wildcard from EXPLAIN pattern used in the the grok pattern in MySQL slowlog ingest pipeline.
Why is it important?
It will fix excessive log messages produced every time the pipeline is used:
Checklist
- [ ] I have commented my code, particularly in hard-to-understand areas- [ ] I have made corresponding changes to the documentation- [ ] I have made corresponding change to the default configuration files- [ ] I have added tests that prove my fix is effective or that my feature worksRelated issues