Created 09-22-2017 07:23 AM
Hi ,
In my project I am using Nifi to read log file from tomcat and process those data in a spark application , after that insert those process data in DB.
But my problem is that , at app server level , I have 4 tomcat cluster(4 different log file) in 2 different box and I have mark out which data is from which cluster at spark level. In my present set up I have 2 tailFile processor in Nifi which pointing to single outport , in per box but not able to identify which data is from which cluster at spark level.
Is there any option in tailFile processor to add some suffix or prefix or file name(or any attribute) in each record ? so that I can identify each record is coming from which cluster and persist in db in that way?
Any help will be highly appreciated ....
Thanks in advance
Created on 09-22-2017 12:32 PM - edited 08-18-2019 12:15 AM
A simple way to do this is to use a ReplaceText processor after the TailFile.
ReplaceText gives you the option to configure which Replacement Strategy to use. Using 'Prepend' will insert the replacement value at the start of each file or line (depending on what you've configured 'Evaluation Mode' to be):
So a ReplaceText with the following configs will give you what you need:
Created on 09-22-2017 12:32 PM - edited 08-18-2019 12:15 AM
A simple way to do this is to use a ReplaceText processor after the TailFile.
ReplaceText gives you the option to configure which Replacement Strategy to use. Using 'Prepend' will insert the replacement value at the start of each file or line (depending on what you've configured 'Evaluation Mode' to be):
So a ReplaceText with the following configs will give you what you need:
Created 09-23-2017 05:17 PM
Thanks a lot for your help , you saved my day ... thanks again .....