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