增加jsonPath解析判断(TSG-8341)
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.zdjizhi</groupId>
|
||||
<artifactId>log-olap-analysis-schema</artifactId>
|
||||
<version>210908-security</version>
|
||||
<version>211105-flattenSpec</version>
|
||||
|
||||
<name>log-olap-analysis-schema</name>
|
||||
<url>http://www.example.com</url>
|
||||
|
||||
@@ -139,8 +139,10 @@ public class MapParseFunction implements MapFunction<String, Tuple3<String, Stri
|
||||
if (StringUtil.isNotBlank(expr)) {
|
||||
String operateValue = JsonParseUtil.getString(message, fieldName);
|
||||
ArrayList<String> read = JsonPath.parse(operateValue).read(expr);
|
||||
String flattenResult = read.get(0);
|
||||
dimensions.put(resultKeyName, flattenResult);
|
||||
if (read.size() >= 1) {
|
||||
String flattenResult = read.get(0);
|
||||
dimensions.put(resultKeyName, flattenResult);
|
||||
}
|
||||
}
|
||||
} catch (ClassCastException | InvalidPathException e) {
|
||||
logger.error("设备标签解析异常,[ " + expr + " ]解析表达式错误" + e);
|
||||
|
||||
Reference in New Issue
Block a user