Created on 01-24-2020 04:11 AM - edited 01-24-2020 04:19 AM
The FlowFile is not valid json.
Try something like a basic json example found on the internet:
{"results":[{"term":"term1"},{"term":"term2"}..]}
Notice the object results is the array of values and everything is "quoted".
Something like this based on your sample image:
{ "world_rank": "1", "country": "China", "population": "1388232694", "World": "0.185" }
If you have to use what you have in the sample image, then you will need to extracText (link here for examples of regex to match values) to get the values for world_rank, country, population, world.
Each values attribute regex like this:
.*world_rank :(.*?) .*
.*country: (.*?) .*
.*population: (.*?) .*
.*world: (.*?) .*
Then use attributesToJson to build the Json object of the attributes you defined above which you can then send to the reader and ultimately to MongoDb.
If my reply helps you solve your Use Case, please accept it as a solution to close the topic.