I have file in Linux like below.
20230512 12:42:06 INFO: job ID
20230512 12:42:06 INFO: workflowID
20230512 12:42:06 INFO: {'jobsData': [{'jobID': '123_abc', 'jobStatus': 'RUNNING'}], 'timeoutData': {}, 'workflowID': 'bbc_999', 'workflowState': 'RUNNING'}
XXXX
YYY
ZZZ
Now from this file I want to find out the line where I have the string jobID
is present.
I did like below
grep 'jobID' file_name
I get the below result
20230512 12:42:06 INFO: {'jobsData': [{'jobID': '123_abc', 'jobStatus': 'RUNNING'}], 'timeoutData': {}, 'workflowID': 'bbc_999', 'workflowState': 'RUNNING'}
Now from this I want to extract data for jobID
and workflowID
and store them as variables
jobID='123_abc'
workflowID='bbc_999'
How can I do that