Member since
06-08-2017
1049
Posts
518
Kudos Received
312
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 11245 | 04-15-2020 05:01 PM | |
| 7156 | 10-15-2019 08:12 PM | |
| 3134 | 10-12-2019 08:29 PM | |
| 11565 | 09-21-2019 10:04 AM | |
| 4361 | 09-19-2019 07:11 AM |
08-09-2018
02:33 PM
1 Kudo
@Rinki Flow: 1. You can list out the files from the directory on every first day of month and check the filename attribute using RouteOnAttribute Processor to get only the current date files. In RouteOnAttribute processor you can use either of the above attributes to making use of nifi expression language we can only filtering out only the required files. 2.You can use ReplaceText processor to replace all this required metadata and store into HDFS/Hive..etc i'm thinking filetype is csv,avro,json so i kept expression like ${filename:substringAfter('.')} Replacement Value
${filename},${file.creationTime},${filename:substringAfter('.')},${file.size} To store the data to table you can use PutHDFS and create table on top of this directory. 3.You can use cron schedule to run the processor on first day of month and Execution in only on Primary node - If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.
... View more
08-09-2018
01:31 PM
2 Kudos
@Vaibhav Kumar Please change EvaluateJsonPath processor configs Destination to flowfile-attribute Now the processor will add the attribute to the flowfile then in JsonQueryElasticSearch processor will gets the attribute value and runs the query on ElasticSearch. With Destination as flowfile-content will overwrites the existing flowfile content with PROC_INST_ID_ value. JsonQueryElasticSearch Relationships: Only feed the required relationships to PutFile processor i.e. hits (or) aggregations Flow:
... View more
08-08-2018
03:39 PM
@Bharath
Sudharsanam
Hmm, If possible please share your flow template (or) all the processors that you are using and configs screenshots of them.
... View more
08-08-2018
02:38 PM
@Bharath
Sudharsanam
Sure, Invoke HTTP configs: \ Template for the flow: Save/Upload the template to your nifi instance and test it out. 211811-invokehttp.xml - If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.
... View more
08-08-2018
12:20 PM
@Gillu
Varghese
if you are using Method1: Then ListFIle processor output's flowfile with filename attribute associated with it. In Method2: We are listing out the files in the directory then preparing filename attribute to the flowfile. Then Fetch File Processor Fetches the files in the directory. In both methods works if the filename keep changing also, as we are dynamically adding filename attribute to the flowfile.
... View more
08-08-2018
03:06 AM
@Bharath
Sudharsanam
TO get the value of attribute we need to use `${attribute_name}` in NiFi I am having zip attribute to the flow file,I tried with below as Remote URL in Invoke Http processor and able to get the response back https://api.census.gov/data/1994/zbp?get=ST&for=zipcode:${zip} Example: Flow: Generateflowfile configs: Output: [["ST","zipcode"],
["48","77058"]] I'm not sure about this &key=mykey parameters in your shared URL. If you are not using them just exclude them from the Remote URL and run again.
... View more
08-08-2018
02:45 AM
@Bharath
Sudharsanam
Could you please add more details like processor configs screenshot's, Flow and Rest API URL that you are trying to get response from?
... View more
08-08-2018
02:43 AM
@Gillu
Varghese
If you know the filename and path that the file has stored in the directory then you can do this in one flow.. flow: generate flowfile->update attribute->execute stream->fetch file If you don't know the filename that you have stored using execute Stream command processor then Method1: Need to use as a separate process to list the files in the directory and move them to another location. Method2: Another approach is to after execute stream command processor use another execute stream command processor to list the files and extract the file names as attributes then use Fetch File processor to move another location. Flow: generate flowfile->update attribute->execute stream->execute stream->Split Text -> Extract Text -> fetch file Refer to this link describes how to get files from the directory. In addition If your filename having some timestamp value then using route on attribute you can check the filename values also.
... View more
08-08-2018
02:25 AM
1 Kudo
@Gillu
Varghese
You can use ListFile/ListHDFS processor to check for the new files that are created in the directories. Then use FetchFile(Fetch + move)/MoveHDFS processors to move the fetched files to other location.
... View more
08-08-2018
02:22 AM
@Bharath
Sudharsanam
Yes, leave the Fetch File processor property as default. processor will fetches those files from the directory.
... View more