Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Rama_Sunkara
Contributor
Contributor

Not able to parse JSON object

Hi,

I am new to Talend. Need help to parse below json object. I am not able to parse below JSON object.

{"host":{"host":"MRK-SITE1_MX64","name":"MRK-SITE1_MX64"},"groups":["MRK/Discovered Hosts","MRK/SageNet Solutions Lab (SPOG)"],"applications":["MRK Raw Items"],"itemid":5000789,"name":"MRK Appliance Uplink statuses","clock":1615149688,"ns":7987118,"value":"[{\"networkId\":\"N_AP378907\",\"serial\":\"KPW-ABT-33456\",\"model\":\"BX98\",\"lastReportedAt\":\"2021-03-07T20:41:00Z\",\"uplinks\":[{\"interface\":\"Link1\",\"status\":\"active\",\"ip\":\"148.72.102.467\",\"gateway\":\"148.72.102.468\",\"publicIp\":\"148.72.102.467\",\"primaryDns\":\"8.8.8.8\",\"secondaryDns\":\"1.1.1.1\",\"ipAssignedBy\":\"static\"},{\"interface\":\"Link2\",\"status\":\"ready\",\"ip\":\"192.168.66.105\",\"gateway\":\"192.174.19.1\",\"publicIp\":\"166.166.86.193\",\"primaryDns\":\"192.174.19.6\",\"secondaryDns\":\"192.174.19.1\",\"ipAssignedBy\":\"dhcp\"}]}]","type":4}

Thank you,

Rama

Labels (6)
4 Replies
Anonymous
Not applicable

Hi

Try to create a Json metadata and follows the wizards to extract the data you want.

0695b00000IdlYyAAJ.png 

Let me know if you have any troubles.

 

Regards

Shong

Rama_Sunkara
Contributor
Contributor
Author

Hi Shong,

Thank you very much for your help.

Able to parse elements host, host.name, groups, applications, itemid, name, clock, ns. Not able to parse child elements of value. Value is coming as single string. How can I parse child elements of Value.

Value is containing "\" and double quotes ("/"")at starting and ending.

I need to parse sub elements of value and I need to store in database.

 

"value":"[{\"networkId\":\"N_AP378907\",\"serial\":\"KPW-ABT-33456\",\"model\":\"BX98\",\"lastReportedAt\":\"2021-03-07T20:41:00Z\",\"uplinks\":[{\"interface\":\"Link1\",\"status\":\"active\",\"ip\":\"148.72.102.467\",\"gateway\":\"148.72.102.468\",\"publicIp\":\"148.72.102.467\",\"primaryDns\":\"8.8.8.8\",\"secondaryDns\":\"1.1.1.1\",\"ipAssignedBy\":\"static\"},{\"interface\":\"Link2\",\"status\":\"ready\",\"ip\":\"192.168.66.105\",\"gateway\":\"192.174.19.1\",\"publicIp\":\"166.166.86.193\",\"primaryDns\":\"192.174.19.6\",\"secondaryDns\":\"192.174.19.1\",\"ipAssignedBy\":\"dhcp\"}]}]"

 

Thank you,

Rama

Anonymous
Not applicable

First, extract the string of Value element, and then use another tExtractJasonFields to parse the string.

 

Rama_Sunkara
Contributor
Contributor
Author

Thank you very much Shong.