Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to append Extract Text value to filename

Highlighted

How to append Extract Text value to filename

Contributor

Hi,

I have tried more a days on that particular issue, I had issue when i extract based on regexp, i got data in data providence flow file. My aim is After extract text processor -> needs to append the extracted value to filename. Normally filename propertiy added filename using update attribute. Please give me suggestion how do i append the values to puthdfs file. It would much helpful!!!

Thanks.

3 REPLIES 3

Re: How to append Extract Text value to filename

Super Guru

@Varun R

Once you extracted value then use Update Attribute and add new property as

filename

${filename}${extracted_value}

so we are adding the extracted value to the filename.

(or)

filename

${filename:append(${extracted_value})}

Both these will result the same filename.

56708-updateattribute.png

Re: How to append Extract Text value to filename

Contributor

sorry i wont able get update attribute value to puthdfs file. i have extracted value as you mentioned below

https://community.hortonworks.com/questions/170847/how-to-extract-query-param-from-nifi.html

Pls suggest me!! thanks

Re: How to append Extract Text value to filename

Super Guru
@Varun R

Once we update the filename the same filename will be used to store in HDFS directory.

lets consider filename value is 1509099 and extracted_value is 20180214 so once we update the filename using update attribute ${filename}${extracted_value} then the new filename would be 150909920180214.

now in puthdfs you have specified /tmp directory to store above file then in hdfs /tmp directory will have the above file

bash# hdfs dfs -ls /tmp/
Found 1 items -rwxrwxrwx 3 - nifi hdfs 10 2018-02-14 07:02 /tmp/150909920180214

if you are still facing issues please attach more details(processor config screenshots and give more details about how you are updating filename, extracting values).

Don't have an account?
Coming from Hortonworks? Activate your account here