Created 07-16-2023 11:12 PM
How to save NIFI Error log to database table ?
Created on 07-17-2023 08:38 AM - edited 07-17-2023 08:41 AM
@Madhav_VD This is a job that nifi can do itself. You would just tail the log file w/ nifi TailFile.
Once you have the log file going into flowfiles in nifi, you can build your flow to filter lines you want to versus lines you do not want. Then when ready use any flavor of database processor (ExecuteSQLRecord, ExecuteSQL, PutSQL, PutDatabase, etc) to translate the log line into a sql insert statement.
Created 07-17-2023 02:41 AM
@Madhav_VD, Welcome to our community! To help you get the best possible answer, I have tagged in our NiFi experts @cotopaul @SAMSAL @MattWho who may be able to assist you further.
Please feel free to provide any additional information or details about your query, and we hope that you will find a satisfactory solution to your question.
Regards,
Vidya Sargur,Created on 07-17-2023 08:38 AM - edited 07-17-2023 08:41 AM
@Madhav_VD This is a job that nifi can do itself. You would just tail the log file w/ nifi TailFile.
Once you have the log file going into flowfiles in nifi, you can build your flow to filter lines you want to versus lines you do not want. Then when ready use any flavor of database processor (ExecuteSQLRecord, ExecuteSQL, PutSQL, PutDatabase, etc) to translate the log line into a sql insert statement.
Created 11-13-2023 10:39 PM
We did this at our end and ended up re-cycling the provenance repository much faster than usual. The huge amount of data that an output of a tailfile generates can fill up both your content and provenance repositories.
Created 07-17-2023 12:06 PM
Hi @Madhav_VD ,
In addition to what @steven-matison has mentioned which will work, there is another option where you can capture errors through setting up "SiteToSiteBulletinReportingTask" which will channel all errors to an input port where you can capture the error information in json format from all processors and all nodes in cluster and then store that error in sql or send notification email. This option might require additional steps to set up but its worth it specially if you have cluster. For more info on how to set up the "SiteToSiteBulletinReportingTask" please refer to : https://pierrevillard.com/2017/05/13/monitoring-nifi-site2site-reporting-tasks/
Hope that helps
Created 07-20-2023 10:53 PM
@Madhav_VD, Have any of the replies helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.
Regards,
Vidya Sargur,