We have servers which are writing their logs out in JSON format. An example:
{"message":{"description":"System error, contact application support team","exception":"java.util.NoSuchElementException","user_agent":"Jodd HTTP","code":"SYSTEM_ERROR","stacktrace":"[java.util.LinkedList.removeFirst(LinkedList.java:268), java.util.LinkedList.pop(LinkedList.java:799), com.company.i360.core.drools.DroolRule.pop(DroolRule.java:350), com.company.i360.core.drools.DroolsService.getSession(DroolsService.java:212), com.company.cloud.edge.rules.v1.EdgeRulesLogic.applyRules(EdgeRulesLogic.java:36), com.company.cloud.edge.rules.v1.EdgeRulesWebServiceV1.eventRules(EdgeRulesWebServiceV1.java:38), sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.lang.reflect.Method.invoke(Method.java:606), com.company.i360.core.web.task.WebTask.execute(WebTask.java:288), com.company.i360.core.web.Resolver.executeWebServiceTask(Resolver.java:148), com.company.i360.core.web.Resolver.resolve(Resolver.java:69), com.company.i360.core.web.MainServlet.service(MainServlet.java:144), javax.servlet.http.HttpServlet.service(HttpServlet.java:731), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208), org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208), org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218), org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122), org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505), org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169), org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103), org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956), org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116), org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:442), org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1082), org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:623), org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61), java.lang.Thread.run(Thread.java:745)]","type":"runtime","url":"/cloud-edge/action/edge-rules-v1/event-rules"},"timestamp":"2016-11-04 16:21:33,584", "loggerName":"sys.web", "level":"ERROR", "threadName":"7631082047"
Since the line already has the "message" field defined it seems like logstash is having issues - deciphering what it is supposed to do. If I add a JSON filter for the message field then LS has trouble saving the contents saying the field "description" is unknown - " "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse [message]", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"unknown property [description]"}}}}, :level=>:warn}"
How do I get LS to realize the "message" is not the whole message so it can evaluate the line properly?