Transform text output to generic json format