Using properties

You can use node properties almost everywhere in Rudder:

  • in directive parameters
  • in the technique editor
  • in your own techniques and generic methods

To use a property, simply use the variable node.properties with the variable call syntax.

Example with a property named datacenter:

${node.properties[datacenter]}
[Warning]Warning

Before Rudder 3.1.14 and 3.2.7, node properties could not be used in JavaScript expressions (see following section), since they are evaluated during policy generation and node properties were only made available to agents at runtime. Since Rudder 3.1.14, 3.2.7 and 4.0.0 and later, you can enable a feature switch in "Administration/Settings" to enable node properties expansion in directive parameters. More details are available at the section called “Node properties expansion in directives”.

In a mustache template, use:

{{{vars.node.properties.datacenter}}}