Hi I am trying to create regular expression for below log which reads Starting from ERROR and complete stack after that.

Log:

17/11/28 08:49:32 INFO CatalystSqlParser: Parsing command: string
17/11/28 08:49:32 ERROR ApplicationMaster: User class threw exception: java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)

Output should be


ERROR ApplicationMaster: User class threw exception: java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)

Regular Expression used
?<TYPE>(ERROR))\s(.*)

The above regular expression is only giving me output as one line and skipping newline
[ERROR ApplicationMaster: User class threw exception: java.lang.reflect.InvocationTargetException]

Please help me on this.

Thanks