-
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
Support glob patterns in diskio devices option #2726
Comments
Does this work? Still regular expressions could be nice over glob patterns in many cases, but we would have to introduce them in a backwards compatible way. |
@danielnelson sadly, that seems to include sda1 too. In any case, we have machines with >26 SCSI devices (sdaa, etc.). |
Are you sure? It seems to work for me, but I only have sda, sda1, sda2. Telegraf is using https://github.com/gobwas/glob for all filters, there is a list of supported patterns there. For sdaa, assuming this works at all, you could always try On the topic of supporting regular expression filters, we could have an option on agent to select the pattern type, but I'm concerned that it will be confusing when people try to copy the config files of others. Another option is regex variants of every filter. I'll have to think about if the added complexity is worth it. |
With our version of telegraf (built off 91f48e7), this config:
Results in this output:
It may be that it works in a later version. I'll try that later. But would it be possible to change it to attempt to compile a regular expression based on the config, and if that fails fall back to glob? |
The problem is that some patterns are both valid regex and glob, but they have different meanings. |
If you required the regex to be in the form /^regex$/ (i.e with "/" at the start and end), I think that would be enough to work as no glob will end with / and match any real device. |
It looks like the glob syntax above only works in master (1.3) at this point. I think this could be another reasonable way to allow regex. It might not be 100% compatible but it is pretty close. Since tagpass is a global filter and so any changes would have wide repercussions, and considering there is a pattern that works fairly well with the latest glob patterns, I think we should just add glob support to the diskio devices option, similar to what was discussed in #1073. |
Thanks. We plan to upgrade as soon as you cut a 1.3 release (I understand a rc is due imminently) so the glob syntax is a nice work around (I pushed that new config). If you do support regex's in future, that would be ideal for us; if only because it feels like the right way to achieve what we want to achieve! |
Yes 1.3rc1 hopefully today assuming I can figure out how to change the package builds to use go1.8.1. I'm going to rename this ticket to reflect what I think we should change on the diskio plugin in the short term. |
By default, diskio ends up capturing for every partition. This probably isnt what most people want, but passing in regular expressions does not work.
This works (but includes sda AND sda[123]:
This does not work, but should:
The text was updated successfully, but these errors were encountered: