Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
In fact, I just started working with talend open studio for data integration; I want to export a array long json ;I have a file containing; This showed me that the debianbug field does not always appear
How I would like the output to look like:
CVE | Scope | debainbug | description | status | fixed_version | urgency |
They all appear to be individual CVE sections (and some are), but if you look deeper you will see that some are grouped together.
my job :
tExtractjson1:
textarctjson2:
excute:the field is empty/null !!!
Does anyone have any advice or ideas on how I can achieve this?
I use "Talend open studio for data integration version 7.1.1.2018102681147
Thank you very much for your time and help
Best regard
Mitra
Hi @mitra1367 ,
Here is the job and i just imported an additional jar and you can find it here http://www.java2s.com/Code/Jar/j/Downloadjsonsimple111jar.htm.
---
Please give Kudos and mark topics as solved where appropriate.
Please attach your input file in a plain text file or jsonl file but not in docx. The docs contains only one record and the given json is too large to copy and paste into a notepad++. Or if possible please add sample records instead of full file.
Hello,
Please add the sample output for one record, so that it will be easy, since the status, urgency and fixed_version keys are present in different objects of releases object. So do you want to consider all the values or from any one of the object. Here is the sample record.
{ "scope":"remote", "description":"FFmpeg before 0.5.4, as used in MPlayer and other products, allows remote attackers to cause a denial of service (memory corruption and application crash) or possibly execute arbitrary code via a malformed WMV file.", "releases": { "buster": {"fixed_version":"7:2.4.1-1","repositories":{"buster":"7:4.1.1-1"},"urgency":"medium**","status":"resolved"}, "stretch": {"fixed_version":"7:2.4.1-1","repositories":{"stretch-security":"7:3.2.12-1~deb9u1","stretch":"7:3.2.12-1~deb9u1"},"urgency":"medium**","status":"resolved"}, "sid": {"fixed_version":"7:2.4.1-1","repositories":{"sid":"7:4.1.3-1"},"urgency":"medium**","status":"resolved"} } }
hello
first of all, thank you for your answer.
next, did you see my json file with all the CVEs?
in fact, i khnow that the status, urgency and fixed_version keys are present in different objects of releases object but in all objects they have the same values so it's no different I extract status, urgency and fixed_version keys are present from which object.
what is your advice?
thank you to you
Hi @mitra1367,
It is depends on your requirement, to consider one object from releases object or all objects from releases object. Anyhow if you consider one object the output will be as follows.
Note: I just took, limited no of characters of description column to show you the output instead of full value. In the final output i'm getting full description value.
If you consider all objects from releases object, then the output will be as follows