Skip to content
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

regexp parsing corosync-cfgtool output will not work #215

Closed
linuxnase opened this issue Mar 10, 2023 · 2 comments · Fixed by #216
Closed

regexp parsing corosync-cfgtool output will not work #215

linuxnase opened this issue Mar 10, 2023 · 2 comments · Fixed by #216

Comments

@linuxnase
Copy link

In collector/corosync/parser.go line 154
There is a bug in the regexp when parsing corosync-cfgtool -s output:
re := regexp.MustCompile(`(?m)(?P<prefix>RING|Link) ID (?P<number>\d+)\s+(?P<id>id|addr) \s*= (?P<address>.+)\s+status \s*= (?P<status>.+)`)
corosync-cfgtool outputs a tab character after "id" and "status", so the regexp with an additional space after id/status will not match. Without the spaces in front of "\s" the regexp will work.
...(?P<id>id|addr)\s*= (?P<address>.+)\s+status\s*=...

@stefanotorresi
Copy link
Member

hey, thanks for reporting this! It should now be fixed, could you please confirm that by building from the latest sources?

@linuxnase
Copy link
Author

Hi Stefano, problem solved 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants