2017-11-10 3 views
1
私は OstrosLogViewerでのように見えるkarafログファイル解析する

OstrosLogViewerパーサ

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 

ログパターンは次のとおりです。

%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32C %4L | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n 

私はパターンを作成しました。しかし、解析は失敗します。

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 

私も以下で試しました。しかし、どちらも解析されません。

type=log4j 
pattern=TIMESTAMP|LEVEL|THREAD|CLASS|BUNDLEMESSAGE 
dateFormat=HH:mm:ss,SSS 
name="TEST2" 
charset=UTF-8 

答えて

0

私は、次のパーサで解析することができました:

type=log4j 
pattern=TIMESTAMP | LEVEL | THREAD | .CLASS MESSAGE 
dateFormat=HH:mm:ss,SSS 
name=Stackoverflow 
charset=UTF-8 

あなたはBUNDLEMESSAGEMESSAGE instaedを使用する必要があります。 |の前後にスペースもあります。