Regex - Multi
can we use parse regex multi options or any other operators to get the output as below from the message:
"type" ="INFO"
"code"="INFORMATION"
"description"="Processing application : external application 10.\"
"response.text from UoA : {\"dateProcessed\":\"2020-01-02T19:57:13.442+13:00\",\"applicantId\":752313116,\"externalApplicantId\":\"300008070\",\"status\":\"FAILURE\",\"applications\":[{\"externalApplicationId\":\"10\",\"programmeCode\":\"BSC\",\"campusCode\":\"\",\"termCode\":\"1203\",\"plans\":[\"CHEM-BSC\"],\"messages\":[]}],\"messages\":[{\"type\":\"INFO\",\"code\":\"INFORMATION\",\"description\":\"Processing application : external application 10.\"},{\"type\":\"INFO\",\"code\":\"INFORMATION\",\"description\":\"Validated application and structure OK.\"},{\"type\":\"INFO\",\"code\":\"INFORMATION\",\"description\":\"Completed initial validation of request.\"},{\"type\":\"INFO\",\"code\":\"INFORMATION\",\"description\":\"Found existing identity from ID.\"},{\"type\":\"ERROR\",\"code\":\"INVALID_APPLICATION\",\"description\":\"Applicant email address is different in EPR.\"},{\"type\":\"ERROR\",\"code\":\"ORCHESTRATION_FAILED\",\"description\":\"Orchestration failed with issues for external application 10.\"}]}"
-
Yes, something like the following should get you started:
parse regex "{\\\"type\\\":\\\"(?<type>[^\\]+)\\\",\\\"code\\\":\\\"(?<code>[^\\]+)\\\",\\\"description\\\":\\\"(?<description>[^\\]+)\\\"}" multi
it will put out the fields "type", "code", and "description" from the sample text
Please sign in to leave a comment.
Comments
1 comment