On-demand macros—which have existed since Nagios 2.0—reference the same contents as standard macros do. The subtle difference between them lies in the context of what they reference. Whereas standard macros refer exclusively to the host, service, or contact object currently being used, on-demand macros enable access to values from any external objects you please:
The macros are the same as standard macros, but their names include the name of the host to which the reference is made. The colon is used as a separator. For services, the service name also needs to be specified, again separated with another colon:
If the host field is left empty, ...