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]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Who agreed with this solution

avatar
Super Guru

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.  

View solution in original post

Who agreed with this solution