I want to parse in OstrosLogViewer
a karaf log file that looks like:
15:01:56,405 | INFO | Framework stop | .osgi.CXFExtensionBundleListener 112 | 101 - org.apache.cxf.cxf-core - 3.1.5 | Removing the extensions for bundle 174
15:01:56,405 | INFO | Framework stop | .osgi.CXFExtensionBundleListener 112 | 101 - org.apache.cxf.cxf-core - 3.1.5 | Removing the extensions for bundle 111
15:01:56,405 | INFO | Framework stop | .osgi.CXFExtensionBundleListener 112 | 101 - org.apache.cxf.cxf-core - 3.1.5 | Removing the extensions for bundle 175
Log pattern is:
%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32C %4L | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n
I created a pattern. But parsing fails.
type=log4j-native
conversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32C %4L | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n
name="Test"
charset=UTF-8
I also tried with below. But it doesn't parse either.
type=log4j
pattern=TIMESTAMP|LEVEL|THREAD|CLASS|BUNDLEMESSAGE
dateFormat=HH:mm:ss,SSS
name="TEST2"
charset=UTF-8
I was able to parse with following parser:
You have to use
MESSAGE
instaed ofBUNDLEMESSAGE
. There are also spaces before and after|
.