云数据迁移 CDM-正则表达式分隔半结构化文本:Log4J日志
Log4J日志
- 日志样例:
2018-01-11 08:50:59,001 INFO [org.apache.sqoop.core.SqoopConfiguration.configureClassLoader(SqoopConfiguration.java:251)] Adding jars to current classloader from property: org.apache.sqoop.classpath.extra
- 正则表达式为:
^(\d.*\d) (\w*) \[(.*)\] (\w.*).*
- 解析出的结果如下:
表1 Log4J日志解析结果 列号
样值
1
2018-01-11 08:50:59,001
2
INFO
3
org.apache.sqoop.core.SqoopConfiguration.configureClassLoader(SqoopConfiguration.java:251)
4
Adding jars to current classloader from property: org.apache.sqoop.classpath.extra