Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 11-09-2022 06:05 AM
Hello,
I could not split a JSON due to a special ETX character existing in a JSON value, SplitJson processor returns an error that it is not a Valid JSON.
The JSON looks like that:
[ {"key_data":"val_data"},
{"key_data":"val_ETXdata"},
{"key_data":"val_data"},
{"key_data":"val_data"},... ]
I used The next regex expression to replace it but it doesn't work:
\x03(?=[^"]*")
Created 11-09-2022 08:37 AM
Hi,
I think you are having an issue because you have carriage return (\r\n) in the json , try using regex replace for the following as well: [\r\n]
Hope that helps, if it does please accept solution.
Thanks
Created on 11-09-2022 08:41 AM - edited 11-09-2022 08:42 AM
No, it is not the problem, the problem is due to the EXT symbol, \n\r\t\" am filtering them in other processors, Am filtering more than 10000 JSON files the error happens only with 4 files that contain ETX.
Created 11-09-2022 01:09 PM
can you send me a sample json data with the error. The one you posted seems to be valid and Im able to split it .
Created on 11-10-2022 02:21 AM - edited 11-10-2022 02:22 AM
share please your email
Created on 11-10-2022 08:14 AM - edited 11-10-2022 08:23 AM
Hi,
I tried the follow pattern on the sent file and it worked: [\x03]+
Created 11-10-2022 08:36 AM
I tried both solutions
I got this error
Failed to process session due to null; Processor Administratively Yielded for 1 sec: java.nio.BufferOverflowException
Created on 11-10-2022 11:26 AM - edited 11-10-2022 11:27 AM
can you share the configuration for the ReplaceText Processor? Also how big is the jsonfile?
Created 11-10-2022 11:31 AM
properties are the same as in the picture you have shared.
Created 11-10-2022 12:08 PM
Not sure how big is your Json and if its well formatted into multiple line. Make sure you have the Evaluation Mode is set to Line-by-Line , also you can increase the Maximum Buffer Size incase the text processed is greater than 1MB. Also what version of Nifi are you using ? there seems to be a bug around that as well where the flowfile will remain in the upstream queue and the overflow error is thrown: https://issues.apache.org/jira/browse/NIFI-10154