Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

extract attribute and value from the flowfile using NiFi

Highlighted

extract attribute and value from the flowfile using NiFi

New Contributor

Hi All,

so I have a file coming in following format:

{"Field_1":0.01,"abc_id":5,"pqr_id":"0","xyz_id":946715026,"items":130,"Epoch":"130723413","measurement":"milliohm/s"} {"Field_2":0.01,"abc_id":2,"pqr_id":"5","xyz_id":841712547,"items":190,"Epoch":"130723414","measurement":"meter/m5"}

-

-

-

-

-

.....and so forth I have multiples rows with attribute name: values.

What processor to use to separate the attribute as fields/columns and parse its respective values.

I want to parse the file in a way I can extract the field names and values separately as my ultimate goal is to feed the file data into MySQL(table schema in MySQL is defined Below:)

Field_1, Field_2, abc_id,pqr_id,xyz_id,items,Epoch,measurement

How can I achieve the whole use case in NiFi? I think I can achieve this using some kind of regular expression but I am not sure what regular expression will help me get the desired output. Any suggestion is much appreciated. Thanks!