增加jsonpath解析判断(TSG-8341)

This commit is contained in:
qidaijie
2021-11-05 10:02:06 +03:00
parent f8706bfa1d
commit 159d00cfb0
2 changed files with 6 additions and 8 deletions

View File

@@ -6,7 +6,7 @@
<groupId>com.zdjizhi</groupId>
<artifactId>log-completion-schema</artifactId>
<version>210908-security</version>
<version>211105-flattenSpec</version>
<name>log-completion-schema</name>
<url>http://www.example.com</url>

View File

@@ -91,11 +91,7 @@ class TransFunction {
* @return account
*/
static String radiusMatch(String ip) {
String account = HBaseUtils.getAccount(ip.trim());
// if (StringUtil.isBlank(account)) {
// logger.warn("HashMap get account is null, Ip is :" + ip);
// }
return account;
return HBaseUtils.getAccount(ip.trim());
}
/**
@@ -164,9 +160,11 @@ class TransFunction {
try {
if (StringUtil.isNotBlank(expr)) {
ArrayList<String> read = JsonPath.parse(message).read(expr);
flattenResult = read.get(0);
if (read.size() >= 1) {
flattenResult = read.get(0);
}
}
} catch (ClassCastException | InvalidPathException e) {
} catch (ClassCastException | InvalidPathException | ArrayIndexOutOfBoundsException e) {
logger.error("设备标签解析异常,[ " + expr + " ]解析表达式错误" + e);
}
return flattenResult;