Member since
06-06-2018
4
Posts
0
Kudos Received
0
Solutions
09-28-2018
05:51 PM
@Suhas Reddy All list processors in NiFi are stateful processors i.e. these processors stores the state until last time of execution and then the next run it will pull only the delta files(files added after the stored state) from the S3 buckets/directories. To check the state RightClick on the processor and go to view state then you will find the stored state of the processor and to clear off the state click on clear state button then the processor will run from start(list all the files from the bucket in the first run). Then in the next run will pull only the newly added files in the bucket. `Configure the ListS3 processor with all the mandatory properties then processor and schedule the processor to run then processor will get the files incrementally.` ListS3 Description: 1.Retrieves a listing of objects from an S3 bucket. For each object that is listed, creates a FlowFile that represents the object so that it can be fetched in conjunction with FetchS3Object.
2.This Processor is designed to run on Primary Node only in a cluster. If the primary node changes, the new Primary Node will pick up where the previous node left off without duplicating all of the data. - 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
07-10-2018
01:18 AM
1 Kudo
@Suhas Reddy
Use Replace Text processor to change the contents of flowfile. Search Value ("_id":.*?,).*("eyeColor":.*") Replacement Value $1$2 Character Set UTF-8 Maximum Buffer Size 1 MB //change the value according to flowfile size Replacement Strategy Regex Replace Evaluation Mode Entire text Input: {"_id": "5b42fe8f7f663540330b3bdc","index": 0,"guid": "60358c95-e50c-4f5e-ad48-00d9e1f9a849","isActive": true,"balance": "$2,483.56","picture": "http://placehold.it/32x32","age": 32,"eyeColor": "green"} Output: {"_id": "5b42fe8f7f663540330b3bdc","eyeColor": "green"} If your required output flowfile is {"eyeColor": "green","_id": "5b42fe8f7f663540330b3bdc"} then change the replace text configs to Search Value ("_id":.*?),.*("eyeColor":.*") Replacement Value $2,$1 In addition to achieve the same case by using record oriented processors(Convert Record (or) Update Record) if you know the schema of your json message then use ConvertRecord/UpdateRecord processor to read your incoming data with jsontree reader controller service and configure the only required fields(eyecolor,_id) in JsonRecordSetwriter so that your output flowfile will going to have only the configured fields and this processor works with array of json messages Refer to these links regarding convert record and update record processors. - If the Answer helped to resolve your issue, Click on Accept button below to accept the answer.
... View more