Process plugin: default_value

Last updated on
13 October 2016

The default_value plugin provides the ability to set a fixed default value. The plugin sets the pipeline to the default value if the pipeline has no value (NULL, zero or empty string). The strict configuration key can be used to set the default only when the pipeline value is NULL.

Examples

process:
    uid:
        -
            plugin: migration
            migration: users
            source: author
        -
            plugin: default_value
            default_value: 44

This will look up the source value of author in the users migration and if not found, set the destination property uid to 44.

Configuration keys

  • default_value: The fixed default value to apply.
  • strict: (optional) Use strict value checking. Defaults to false. false = apply default when pipeline value is empty(); true = apply default when value is NULL. Note that the pipeline starts with value NULL.