-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Win_perf_counters plugin regex doesn't work for instances that have back slashes #4499
Comments
cc @vlastahajek |
You could technically use 1 regex |
Found another edge case introduced by my new regex. Fixed:
Updated gist to include it. |
…as it proved to be 40x faster
Thanks for discovering this bug. It is always surpsing what kind of text instance name could be :-). Even though playing with regexp if fun, regexp matching became too complex and slow, so I replaced it with a simple substring searching. Benchmark showed it is 40x faster than regexp. |
Relevant telegraf.conf:
System info:
Telegraf v1.7 - with changes (not affecting this problem)
Windows Server 2012 R2
Steps to reproduce:
Expected behavior:
\BOWSQLTST23A\LogicalDisk(E:\Data\Disk1)\Disk Reads/sec -> "instance":"E:\\Data\\Disk1" "objectname":"LogicalDisk"
Actual behavior:
\BOWSQLTST23A\LogicalDisk(E:\Data\Disk1)\Disk Reads/sec -> "objectname":"Disk1)"
Additional info:
Here is the fix for this from my testing: https://gist.github.com/jedthe3rd/4a361cc19ac4cfd4ccf7bf7547107ead
Relevant regex tests:
https://regex101.com/r/GAnd0s/2
https://regex101.com/r/GAnd0s/3
The text was updated successfully, but these errors were encountered: