The basic format is a sequence of attributename: value
pairs to select nodes which match. You can negate a match by using !attributename: value
. If you do not specify an attribute name, then the nodename
is matched against the bare value.
The value
can be:
www.*
web1,web2
tags
attribute, a set of values, results in all nodes with a set of tags that match.
+
-separated list of values to AND togethera+b
(match node with both tags a
and b
)a+b,x
(match node with both tags a
and b
, or tag x
)The result is all nodes which match all of the clauses.
You can include multiple attribute name/value pairs with the same attribute name, in which case it effectively concatenates all of the values into a comma-separated list, which will not use regular-expression matching for any of those values.
name: web1 name: web2
Is the same as:
name: web1,web2
This does not use regular-expression matching. If you want to combine multiple regular expressions, refer to the regular-expression syntax. For example, you could use anode.*|bnode.*
to match all nodes starting with “anode” or “bnode”.
Examples:
Match a set of nodes by name, includes all the node names listed:
mynode1 mynode2
Include mynode and exclude mynode2:
mynode1 !nodename: mynode2
Include nodes with both of the tags www
and prod
or either of the given hostnames:
tags: www+prod hostname: dev1.example.com,dev2.example.com