首页 > 解决方案 > 解析 log4net 日志并转发到 Logstash

问题描述

2018-05-07 11:38:56,748 [15] 错误 Library.Logger.Log4NetLogger [(null)] - {"Component":"Service","Message":"Exception in Authorization.Exception:No Roles were found for登录 ID: Domain\user0 ","Exception":{"ClassName":"System.Exception","Message":"没有找到登录 ID: Domain\User0","Data":{} 的角色, "InnerException":null,"HelpURL":null,"StackTraceString":" 在 AuthorizationBll.cs 中的 Authorization.GetRoles(String loginId):line 146\r\n 在 AuthorizationBll.CheckAuthorization(String loginId, String operationName) 在 \Services \AuthorizationBll.cs:第 61 行","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":"8\nGetRoles\nServices。BusinessLogic,版本=1.0.0.0,文化=中性,PublicKeyToken=null\nAuthorizationBll\nSystem.Collections.Generic.List`1[System.String] GetRoles(System.String)","HResult":-2146233088,"Source" :"Services.BusinessLogic","WatsonBuckets":null},"ErrorLevel":1,"ErrorLevelType":"Error","CurrentDateTime":"2018-05-07T11:38:56.6918708+05:30","ManagedThreadId ":15,"AdditonalData":null,"Context":null}ErrorLevelType":"Error","CurrentDateTime":"2018-05-07T11:38:56.6918708+05:30","ManagedThreadId":15,"AdditonalData":null,"Context":null}ErrorLevelType":"Error","CurrentDateTime":"2018-05-07T11:38:56.6918708+05:30","ManagedThreadId":15,"AdditonalData":null,"Context":null}

我有这个日志,我想从文本中提取 4 件事并放入弹性搜索。我正在使用以下 grok

%{GREEDYDATA:消息}

  1. 组件名称 2。消息 3:异常 4:堆栈跟踪。

如何才能做到这一点 ?

标签: elasticsearchlogstashkibanalogstash-grok

解决方案


推荐阅读