【发布时间】:2019-01-29 14:15:43
【问题描述】:
1) 如何使用正则表达式捕获 INFO/ERROR/WARN 事件?
2) 如何使用正则表达式捕获不包括 INFO/ERROR/WARN 事件的其余事件?
示例日志如下所示:
[30/07/18 17:42:00:492 XXX] 00000056 SystemOut O 30 Jul 2017 17:42:00:492 [INFO] [xxxxxx] [] xxxxx - The total xxx is 411116 and the memory available is 2638295816.
[30/07/17 17:42:00:492 XXX] 00000056 SystemOut O 30 Jul 2017 17:42:00:492 [ERROR] [xxxxxx] [] xxxxxxx - The total xxx is 111111111 and the memory available is 2638295816.
[30/07/17 17:42:00:492 XXX] 00000056 SystemOut O 30 Jul 2017 17:42:00:492 [WARN] [xxxxxx] [] xxxxxx - The total xxx is 1111111 and the memory available is 2638295816.
[30/07/17 15:37:42:379 XXX] 00001db5 LdapConnectio I xxx.xxx.xx.xx.xxxxx.xxxx.xxxxxxxxxx reCreateDirContext(String errorMessage) xxxxxxxxx The user registry is now connected to 'xxxxxxxxxxxxxx' LDAP Server.
[30/07/17 15:33:59:281 XXX] 0000xxxx0 SystemOut O Into the constructor of xxxxx
【问题讨论】:
标签: regex regex-negation regex-lookarounds