- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Concatenations of Multiple Attributes in Nifi
- Labels:
-
Apache NiFi
Created ‎07-21-2021 08:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have to create one attribute with the following details:
1. There are two attributes are flowing from EvaluateJson Proecessor :
Location1 = $.place1 and Location2 = $.place2
2. There is one string like folder1 is to be append in these attributes as mentioned below:
Place : /folder1/Location1/Location2
I am trying with the below expression:
path: ${path: append("folder1/"):append(${Location1}):append('/'):append(${Location2})}
Please let me know where I am doing wrong.
Early reply will be highly appreciated.
thanks & regards
Created ‎07-22-2021 07:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your expression looks fine.
I just tested as follows:
1. Generateflowfile: Add property Location1, value loc1; Add property Location2, value loc2
followed by:
2. Updateattribute processor: Add property Total, value ${path: append("folder1/"):append(${Location1}):append('/'):append(${Location2})}
Now the output I get is ./folder1/loc1/loc2 which is exactly what I expected.
If you think there may be a problem with parsing the json inthe first place, please inspect your data in the queue directly after parsing, but the concatenation seems to work. (Unless you expected a different outcome, in which case please be very clear in what you expect and see).
- Dennis Jaheruddin
If this answer helped, please mark it as 'solved' and/or if it is valuable for future readers please apply 'kudos'.
Created ‎07-22-2021 07:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your expression looks fine.
I just tested as follows:
1. Generateflowfile: Add property Location1, value loc1; Add property Location2, value loc2
followed by:
2. Updateattribute processor: Add property Total, value ${path: append("folder1/"):append(${Location1}):append('/'):append(${Location2})}
Now the output I get is ./folder1/loc1/loc2 which is exactly what I expected.
If you think there may be a problem with parsing the json inthe first place, please inspect your data in the queue directly after parsing, but the concatenation seems to work. (Unless you expected a different outcome, in which case please be very clear in what you expect and see).
- Dennis Jaheruddin
If this answer helped, please mark it as 'solved' and/or if it is valuable for future readers please apply 'kudos'.
Created ‎07-23-2021 12:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply.
I a able to resolve this issue with your suggestion.
Thanks!
