Hi,
I am trying to parse a log and convert it to json format using java and grok expression.

Log Example
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)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.informatica.compiler.InfaSparkMain$.main(InfaS parkMain.scala:108)
at com.informatica.compiler.InfaSparkMain.main(InfaSp arkMain.scala)
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)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.spark.deploy.yarn.ApplicationMaster$$an on$2.run(ApplicationMaster.scala:637)
Caused by: java.lang.NoSuchMethodError: com.amazonaws.AmazonWebServiceClient.<init>(Lcom/amazonaws/ClientConfiguration;Lcom/amazonaws/metrics/RequestMetricCollector;Z)V
at com.amazonaws.services.s3.AmazonS3Client.<init>(Am azonS3Client.java:562)

My Grok expression:
(?<TYPE>(ERROR))\s+(?<ExceptionTrace>(.*))

But the above expression is just give only 1 st line starting form ERROR as output and not the whole trace.

Please help me on this. Any Simple Regular expression will also help.

Thanks