Pierre Villard created NIFI-14363:
-------------------------------------
Summary: Add a mapTo expression language function
Key: NIFI-14363
URL: https://issues.apache.org/jira/browse/NIFI-14363
Project: Apache NiFi
Issue Type: New Feature
Components: Core Framework
Reporter: Pierre Villard
Assignee: Pierre Villard
*mapTo*
{*}Description{*}:
Returns a string based on the provided mapping rule in order to map the subject
to another string. If the subject is not covered by the mapping rule, then the
subject is returned.
{*}Subject Type{*}: String
{*}Argument{*}:
- {_}mapping rule{_}: The mapping rule is a comma separated list of K:V where
K may be a regular expression and V is the string to return in case K matches
the subject. Examples: 'abc:xyz,foo:poo' and
'att[0-4]:low_range,att[5-9]:high_range,.*:other'
{*}Return Type{*}: String
{*}Examples{*}:
If we have an attribute named "str" with the value "abc", then the following
Expressions will result in the following values:
|Expression|Value|
|`${str:mapTo('abc:xyz,foo:poo')}`|`xyz`|
|`${str:mapTo('foo:poo')}`|`abc`|
|`${str:mapTo('a.c:xyz,.*:foo')}`|`xyz`|
--
This message was sent by Atlassian Jira
(v8.20.10#820010)