We are planning to stream Pivotal Cloud Foundry logs to Logstash, however looking into some log examples when an exception is logged, instead of sending one single log, it is sending each line of the exception as one log. Example (content changed for compliance reasons):
2019-02-27T12:02:57.022-05:00 [APP/PROC/WEB/0] [OUT] Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled."}
2019-02-27T12:02:57.024-05:00 [APP/PROC/WEB/0] [OUT] {"timestamp":"2019-02-27 17:02:57.024","thread":"main","level":"ERROR","logger":"org.springframework.boot.SpringApplication:678","app":"references","version":"3.4.1","msg":"run failed"}
2019-02-27T12:02:57.024-05:00 [APP/PROC/WEB/0] [OUT] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'specialAwesomeFactory' defined in class path resource [config/myConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.sleep.factory]: Factory method 'specialAwesomeFactory' threw exception; nested exception is java.lang.RuntimeException: Error building Factory
2019-02-27T12:02:57.024-05:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:753)
2019-02-27T12:02:57.024-05:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(theResolver.java:241)
2019-02-27T12:02:57.024-05:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractFactory.java:13275)
Since those logs are sent to Logstash one at time, it will (obviously), log multiple logs in Elastic.
Is there a way to consolidate all those exception logs to a single log in Elastic? Honestly, I don't see how, but doesn't hurt asking. We never know...
Thanks,
Rob