I have this log message which is filtered using grok pattern. Entire message gets displayed in a single line in the filtered output.
{
"message": [
"Calling com.portal.ws.service.GvpV2Service@2ad03f20 method createIpVpnAccess\n[2023-02-24T11:11:27.863+0100] [] [\u001b[1;93mWARNING\u001b[0m] [] [\u001b[1;94morg.eclipse.persistence.session./file:/tmp/payaramicro-rt12637138685337820354tmp/applications/ROOT/WEB-INF/classes/_IPConnectionPU\u001b[0m] [tid: _ThreadID=71 _ThreadName=http-thread-pool::http-listener(1)] [timeMillis: 1677233487863] [levelValue: 900] [[\n \nLocal Exception Stack: \nException [EclipseLink-4002] (Eclipse Persistence Services - 2.7.4.payara-p2): org.eclipse.persistence.exceptions.DatabaseException\nInternal Exception: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '2023022411112701071' for key 'PRIMARY'\nError Code: 1062\nCall: INSERT INTO orders (id, account_origin, action, exitCode, message, module, orderid_extern, retries, lineid, ... 191 more\n]]\n\n[2023-02-24T11:11:27.865+0100] [] [\u001b[1;93mWARNING\u001b[0m] [AS-EJB-00056] [\u001b[1;94mjavax.enterprise.ejb.container\u001b[0m] [tid: _ThreadID=71 _ThreadName=http-thread-pool::http-listener(1)] [timeMillis: 1677233487865] [levelValue: 900] A system exception occurred during an invocation on EJB OrdersFacade, method: public void com.gvalportal.dao.OrdersFacade.persistNewOrder(com.gvalportal.workflow.model.WorkflowPass)\n\n[2023-02-24T11:11:27.866+0100] [] [\u001b[1;93mWARNING\u001b[0m] [AS-EJB-00056] [\u001b[1;94mjavax.enterprise.ejb.container\u001b[0m] [tid: _ThreadID=71 _ThreadName=http-thread-pool::http-listener(1)] [timeMillis: 1677233487866] [levelValue: 900] A system exception occurred during an invocation on EJB WorkflowCreateIpVpnAccess, method: public com.gvalportal.workflow.model.BaseResponseType com.gvalportal.workflow.ipvpn.create.wbapppoe.WorkflowCreateIpVpnAccess.processCall(com.portal.workflow.model.WorkflowPass,com.portal.workflow.model.BaseRequestType)\n\n"
}
What should I change in my grok pattern to display this message in a new line in the same field based on the timestamp string like below?
{
"message": [
"Calling com.portal.ws.service.GvpV2Service@2ad03f20 method createIpVpnAccess\n
[2023-02-24T11:11:27.863+0100] [] [\u001b[1;93mWARNING\u001b[0m] [] [\u001b[1;94morg.eclipse.persistence.session./file:/tmp/payaramicro-rt12637138685337820354tmp/applications/ROOT/WEB-INF/classes/_IPConnectionPU\u001b[0m] [tid: _ThreadID=71 _ThreadName=http-thread-pool::http-listener(1)] [timeMillis: 1677233487863] [levelValue: 900] [[\n \nLocal Exception Stack: \nException [EclipseLink-4002] (Eclipse Persistence Services - 2.7.4.payara-p2): org.eclipse.persistence.exceptions.DatabaseException\nInternal Exception: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '2023022411112701071' for key 'PRIMARY'\nError Code: 1062\nCall: INSERT INTO orders (id, account_origin, action, exitCode, message, module, orderid_extern, retries, lineid, ... 191 more\n]]\n\n
[2023-02-24T11:11:27.865+0100] [] [\u001b[1;93mWARNING\u001b[0m] [AS-EJB-00056] [\u001b[1;94mjavax.enterprise.ejb.container\u001b[0m] [tid: _ThreadID=71 _ThreadName=http-thread-pool::http-listener(1)] [timeMillis: 1677233487865] [levelValue: 900] A system exception occurred during an invocation on EJB OrdersFacade, method: public void com.gvalportal.dao.OrdersFacade.persistNewOrder(com.portal.workflow.model.WorkflowPass)\n\n
[2023-02-24T11:11:27.866+0100] [] [\u001b[1;93mWARNING\u001b[0m] [AS-EJB-00056] [\u001b[1;94mjavax.enterprise.ejb.container\u001b[0m] [tid: _ThreadID=71 _ThreadName=http-thread-pool::http-listener(1)] [timeMillis: 1677233487866] [levelValue: 900] A system exception occurred during an invocation on EJB WorkflowCreateIpVpnAccess, method: public com.gvalportal.workflow.model.BaseResponseType com.gvalportal.workflow.ipvpn.create.wbapppoe.WorkflowCreateIpVpnAccess.processCall(com.portal.workflow.model.WorkflowPass,com.portal.workflow.model.BaseRequestType)\n\n"
]
}
This is the grok pattern I am using:
"message" => "%{GREEDYDATA:message}"