简体   繁体   中英

how can we use UpdateAttribute processor for assigning variable of fileflow content in Apache Nifi

I need some help in UpdateAttribute processor, I have a csv file which contain hostnames, i need to separate each hostname in flowfile and pass it as a variable to the REST API. My REST API part is working(by passing manually) fine but didn't get how to pass variable value as hostname in it. Sharing sample file.

SRHAPP001,SRHWEBAPP002,SRHDB006,SRHUATAPP4,ARHUATDB98

I don't quite understand your goal, but I assume that you try to pass the hostname to your REST API module by using FlowFile variables.

You can achieve this by using the ExtractText -Processor. You simply use RegEx for separating your hostnames from the CSV file.

For more information, see https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.12.1/org.apache.nifi.processors.standard.ExtractText/

How can I extract a substring from a flowfile data in Nifi?

If needed, you can split incoming FlowFiles on every hostname by using SplitContent -Processor

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM