User story #3613
closed
Add possibility to create a group with a combinaison of matching a regex and not matching another regex
Added by Fabrice FLORE-THÉBAULT about 11 years ago.
Updated about 11 years ago.
Category:
Web - Nodes & inventories
Description
Let's have a network with one LAN, one DMZ, some hosts with one IP in LAN, some hosts with one IP in DMZ, and some multihomed hosts with one IP in DMZ and one IP in LAN.
I would like to create 3 groups :
- LAN only: hosts with at least one IP in LAN, and no IP in DMZ.
- DMZ only: hosts with at least one IP in DMZ, and no IP in LAN.
- LAN and DMZ: hosts with at least one IP in LAN and one IP in DMZ.
I guess these groups will be quite meaningfull to configure some items depending on the network topology.
For now, it it not possible to create these groups with regexes.
- Project changed from 30 to Rudder
- Category set to Web - Nodes & inventories
- Target version set to 2.7.0~beta1
Hi Fabrice,
Thank you for this use case. Indeed, we can't do (for the moment) such query, and we probably need to improve the search engine to allow for more complex queries.
Do you think an "advanced" mode with combinaision of and, or and not would make sense ?
I was also going to propose to use an inverse match regex (see http://stackoverflow.com/questions/406230/regular-expression-to-match-string-not-containing-a-word for example), but that does not work in that exact use case.
For non multivalued attribute, you can express the condition "not matching WORD with the rexep: ((?!WORD).)* and everything is fine.
But for multivalued attributes (your use case if IP Addresses), it won't work because the semantic is:
"the node is OK if the attribute is present and any of the attribute values matches the regex". So when we have several value for the attribute, and they don't all matches the regex, the entry is OK. We want to be able to express: "the node is OK if the attribute is missing or if none of the attribute value matches the regex".
And for a similar reason, we can't use a filter on "network > IP Address > regex", because in that case, we have one interface not matching but the other matches, and so in fine, the node is OK.
A first very simple workaround is to add a "non matching regex" comparator, so that we can say: "matching ip XXX and not matchin ip YYY".
A combination of "and", "or" and "not" would be awesome! :)
- Status changed from New to 13
- Target version changed from 2.7.0~beta1 to 2.6.3
- Status changed from 13 to Pending release
- Subject changed from impossible usecase: create a group with all hosts with IP from LAN and no IP in DMZ to Add possibility to create a group with a combinaison of matching a regex and not matching another regex
- Target version changed from 2.6.3 to 2.7.0~rc1
- Target version changed from 2.7.0~rc1 to 2.7.0~beta1
- Status changed from Pending release to Released
Also available in: Atom
PDF