Created on 01-06-2021 08:55 AM - edited 01-06-2021 08:56 AM
Hi All,
I have nifi flow fthat fetches one json file and using the extractText processor, i want to store entire flowfile content(assume small json file) into one flowfile attribute. But (.*) is not extracting whole json and instead extracting only { . Please help with Java regular expression to extract full json afnd also share if any Java regular expression documentation which i can refer for Nifi extracttext processor.
I having json file which contains format like
{
"filename1":"insert into filename1",
"filename2":"insert into filename2",
"filename3":"insert into filename3"
}
I will retrieve the filenames in generic way/dynamic using JsonPath(${filename}) in updateattribute .
Please assist to extract whole json content into one flow file attribute .
Thanks
Created 01-06-2021 12:47 PM
Hello,
you could use following regex
[^^]+
with that you should get the whole content.
Please take a look at the property "Maximum Capture Group Length" at the ExtractText Processor, that its not too short.
Created 01-06-2021 12:47 PM
Hello,
you could use following regex
[^^]+
with that you should get the whole content.
Please take a look at the property "Maximum Capture Group Length" at the ExtractText Processor, that its not too short.
Created 01-07-2021 04:23 AM
Hi
Thanks for helping . I am able to get entire content into attribute .
I have one doubt that i have attribute name called "JSONValue" so that extracted value should be in this name but the flowfile content saves into the attribute "JSONValue.0 " as supposed to create value in JSONValue attribute . Please see screen-print for the same . I had to enable "Include Capture Group 0" as True otherwise the Regex not accepting and expecting value 0 to40 other than false.