[resolved] Need help parsing json file

Four Stars

[resolved] Need help parsing json file

Given the following in a json file (call it event.json):
{"fc_Mid":"","GPS Quality":"1","fc_fmi":"14","DSN":"7037452","VIN":"ABC1234567890","sentDateTime":"02/10/2017 18:44:59","type":"Fault Codes","fc_SA":"3","version":"1.00","faultcodeType":"2","fc_speed":"0","longitude":"-74.0088599","fc_pid_sidIndicator":"","fc_spn":"70","fc_odometer":"31411.1","cruiseStatus":"0","pfmDriverId":"244040","fc_rpm":"649","fc_Code":"","vehicleNumber":"10807","ignitionStatus":"1","triggerDate":"02/10/2017 18:44:59","occurrenceCount":"1","urgentFlag":"0","latitude":"40.6117188","companyId":"A899"} 
I don't seem to have luck getting to the elements of this file. Would someone be able to post an example job that parses the elements and just prints them out with tLogRow? What would the loop Json query and mapping look like?
Clearly I need to do more with the data but I can't even get past this first part. 
Many thanks for the help
 - rlm

Accepted Solutions
Highlighted
Community Manager

Re: [resolved] Need help parsing json file

Hi 
Select 'JsonPath without loop' in the readby list of tFileInputJson, and define the mapping fields which you want to extract, see below:

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Highlighted
Community Manager

Re: [resolved] Need help parsing json file

Hi 
Select 'JsonPath without loop' in the readby list of tFileInputJson, and define the mapping fields which you want to extract, see below:

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Four Stars

Re: [resolved] Need help parsing json file

Thank you, Shong, that got me moving. I will no doubt have more questions as I progress deeper into the project and I appreciate your helping out as you did.
- rlm

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch