Skip to main content
Bgrilher
Silver ⭐️
March 8, 2023
Solved

ValidateJson Log in case of validation failure

Is there a way to get or see the log message in case of validation failure of a flow-content versus the provided json schema ? 

MattWho
MattWhoAnswer
Titanium ⭐️⭐️⭐️
March 8, 2023

@Bgrilher 
I not completely clear on your ask here.

According to the ValidateJson processor documentation, a FlowFile Attribute is added to FlowFiles that are routed to the "invalid" relationship:

MattWho_0-1678283988952.png

You can route this "invalid" relationship via a connection to a logAttribute processor which can write a log line out to the nifi-app.log (default) with what was written to this FlowFile attribute.

If you are not actually looking to see it generate log output but just want to see what was written to this FlowFile attribute, you can use NiFi data provenance for this.  
Data provenance will give you ability to see FlowFile metedata for a FlowFile in all stages throughout the dataflow that FlowFile progressed.  You can also view and download the content (if it is still present in a NiFi dataflow or still present in NiFi archive) at by stage of its processing through your dataflow.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt

 

2 replies

MattWho
Titanium ⭐️⭐️⭐️
MattWhoAnswer
Titanium ⭐️⭐️⭐️
March 8, 2023

@Bgrilher 
I not completely clear on your ask here.

According to the ValidateJson processor documentation, a FlowFile Attribute is added to FlowFiles that are routed to the "invalid" relationship:

MattWho_0-1678283988952.png

You can route this "invalid" relationship via a connection to a logAttribute processor which can write a log line out to the nifi-app.log (default) with what was written to this FlowFile attribute.

If you are not actually looking to see it generate log output but just want to see what was written to this FlowFile attribute, you can use NiFi data provenance for this.  
Data provenance will give you ability to see FlowFile metedata for a FlowFile in all stages throughout the dataflow that FlowFile progressed.  You can also view and download the content (if it is still present in a NiFi dataflow or still present in NiFi archive) at by stage of its processing through your dataflow.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt

 

Translate
Bgrilher
BgrilherAuthor
Silver ⭐️
March 8, 2023
Perfect it whas exactly what I missed.

BR,

Bruno
Translate