process function successfully accepts output as text or list of lines
and parses using the map  JSON and stores the output into a dictionary.