Created 10-04-2017 12:34 AM
How would I use one custom property within another in Nifi? @Pierre Villard @Matt Burgess
Eg: I have
prop_1=/path/to/dir1
prop_2=/path/to/dir2
prop_3=${prop_1}/${prop_2}/file1
prop_4=${prop_1}/${prop_2}/file2
Now, within nifi processor, where expression language is supported, when I give
${prop_3} or ${prop_4}
I get error ${prop_1} is not a file or directory.
But if I provide the value as ${prop_1}/${prop_2}/file1, it works.
What is the problem when I give ${prop_3}?
Thanks,
John
Created on 10-04-2017 02:20 AM - edited 08-17-2019 09:35 PM
Hi @John Carter,
This works provided first variables(prop_1,2) are evaluated and assigned to the second(prop_3,4) list.
Which implies the assignment can be done in two stages, assignment of first variables followed by a Update Attribute processor with second list
Here I have tested the same and able to use prop_3/4
First capture three variables fileName,appRootDir, rootDir
followed by a Update Attribute Processor which will assign these variables into a another variable.
which eventually get the variable consolidated path:
Hope this helps!!
Created 10-04-2017 02:30 AM
I have these attributes in my custom property file and I would like to know if there is any possibility that I can directly use prop_3 without using any intermediate processor like update attribute?
Thanks
Created 10-04-2017 02:24 AM
Please note that I have these properties defined in custom property file.