Project

General

Profile

Actions

User story #3613

closed

Add possibility to create a group with a combinaison of matching a regex and not matching another regex

User story #3613: Add possibility to create a group with a combinaison of matching a regex and not matching another regex

Added by Fabrice FLORE-THÉBAULT almost 13 years ago. Updated almost 13 years ago.

Status:
Released
Priority:
1 (highest)
Assignee:
-
Category:
Web - Nodes & inventories
Target version:
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Fix check:
Regression:

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.


Subtasks 1 (0 open1 closed)

User story #3622: Add a "not matching rexex" filter comparator for node searchReleasedFrançois ARMANDActions

Updated by Nicolas CHARLES almost 13 years ago Actions #1

  • 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 ?

Updated by François ARMAND almost 13 years ago Actions #2

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".

Updated by Dennis Cabooter almost 13 years ago Actions #3

A combination of "and", "or" and "not" would be awesome! :)

Updated by Nicolas CHARLES almost 13 years ago Actions #4

  • Status changed from New to 13
  • Target version changed from 2.7.0~beta1 to 2.6.3

Updated by Nicolas CHARLES almost 13 years ago Actions #5

  • Status changed from 13 to Pending release

Updated by Nicolas PERRON almost 13 years ago Actions #6

  • 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

Updated by Nicolas PERRON almost 13 years ago Actions #7

  • Target version changed from 2.6.3 to 2.7.0~rc1

Updated by Nicolas PERRON almost 13 years ago Actions #8

  • Target version changed from 2.7.0~rc1 to 2.7.0~beta1

Updated by Nicolas PERRON almost 13 years ago Actions #9

  • Status changed from Pending release to Released
Actions

Also available in: PDF Atom