diff options
| author | qidaijie <[email protected]> | 2022-09-21 18:37:27 +0800 |
|---|---|---|
| committer | qidaijie <[email protected]> | 2022-09-21 18:37:27 +0800 |
| commit | 30e61c63074c7aec8b2b844a8e80e4c678783c8a (patch) | |
| tree | 2a3332d55f465678e8c70e9fbb4601a900a65c15 | |
| parent | 60d12d3f8c7db5ba72207412bf2d0de9fb709604 (diff) | |
更新Readme内容,增加gtpc_match函数描述等
| -rw-r--r-- | README.md | 15 | ||||
| -rw-r--r-- | src/main/java/com/zdjizhi/tools/general/TransFunction.java | 20 |
2 files changed, 21 insertions, 14 deletions
@@ -21,14 +21,21 @@ * get_value > 获取字段值并追加到新的字段。 * if -> IF函数实现,解析日志构建三目运算;包含判断是否为数字若为数字则转换为long类型返回结果。 +> IF函数实现,解析日志构建三目运算;包含判断是否为数字若为数字则转换为long类型返回结果。 +> 若参数携带 $. 标识,则使用的是数据内的字段值;若不携带则为参数指定的值。 * sub_domain > 获取顶级域名 * radius_match > 根据IP获取对应的Raidus用户信息。 -> 实际数据存储在HBase中,依赖RADIUS-RELATIONSHIP-HBASE-V2程序;使用时加载到内存中加速查询。 -* app_match -> 根据APP_ID获取对应的APP名称 +> 实际数据存储在HBase tsg_galaxy:relation_framedip_account表中,依赖RELATIONSHIP-RADIUS-ACCOUNT程序;使用时加载到内存中加速查询。 +* gtpc_match +> 根据日志common_tunnels内的信息,获取GTPC TEID对应的用户信息(phonenumber、imsi、imei),样例数据: +``` +{"common_tunnels":"[{\"tunnels_schema_type\":\"GTP\",\"gtp_endpoint_a2b_teid\":247749709,\"gtp_endpoint_b2a_teid\":665547833,\"gtp_sgw_ip\":\"192.56.5.2\",\"gtp_pgw_ip\":\"192.56.10.20\",\"gtp_sgw_port\":2152,\"gtp_pgw_port\":2152}]"} +``` +> 实际数据存储在HBase tsg_galaxy:relation_user_teid中,依赖RELATIONSHIP-RADIUS-USER程序;使用时加载到内存中加速查询。 +* ~~app_match~~ +> ~~根据APP_ID获取对应的APP名称~~ 22.02版本后弃用 * decode_of_base64 > 根据编码解码base64,若编码字段为空则根据默认编码解析(UTF-8) * flattenSpec diff --git a/src/main/java/com/zdjizhi/tools/general/TransFunction.java b/src/main/java/com/zdjizhi/tools/general/TransFunction.java index 0263239..48c0813 100644 --- a/src/main/java/com/zdjizhi/tools/general/TransFunction.java +++ b/src/main/java/com/zdjizhi/tools/general/TransFunction.java @@ -54,9 +54,9 @@ class TransFunction { try { detail = ipLookup.cityLookupDetail(ip); } catch (NullPointerException npe) { - logger.error("The MMDB file is not loaded or IP is null! " + npe); + logger.error("The MMDB file is not loaded or IP is null! " + npe.getMessage()); } catch (RuntimeException e) { - logger.error("Get clientIP location error! " + e); + logger.error("Get clientIP location error! " + e.getMessage()); } return detail; } @@ -72,9 +72,9 @@ class TransFunction { try { asn = ipLookup.asnLookup(ip); } catch (NullPointerException npe) { - logger.error("The MMDB file is not loaded or IP is null! " + npe); + logger.error("The MMDB file is not loaded or IP is null! " + npe.getMessage()); } catch (RuntimeException e) { - logger.error("Get IP ASN error! " + e); + logger.error("Get IP ASN error! " + e.getMessage()); } return asn; } @@ -90,9 +90,9 @@ class TransFunction { try { country = ipLookup.countryLookup(ip); } catch (NullPointerException npe) { - logger.error("The MMDB file is not loaded or IP is null! " + npe); + logger.error("The MMDB file is not loaded or IP is null! " + npe.getMessage()); } catch (RuntimeException e) { - logger.error("Get ServerIP location error! " + e); + logger.error("Get ServerIP location error! " + e.getMessage()); } return country; } @@ -151,7 +151,7 @@ class TransFunction { } } } catch (RuntimeException re) { - logger.error("An exception occurred in teid type conversion or parsing of user information!" + re); + logger.error("An exception occurred in teid type conversion or parsing of user information!" + re.getMessage()); } } @@ -188,7 +188,7 @@ class TransFunction { } } } catch (RuntimeException e) { - logger.error("Resolve Base64 exception, exception information:" + e); + logger.error("Resolve Base64 exception, exception information:" + e.getMessage()); } return result; } @@ -210,7 +210,7 @@ class TransFunction { } } } catch (ClassCastException | InvalidPathException | ArrayIndexOutOfBoundsException e) { - logger.error("The label resolution exception or [expr] analytic expression error" + e); + logger.error("The label resolution exception or [expr] analytic expression error" + e.getMessage()); } return flattenResult; } @@ -253,7 +253,7 @@ class TransFunction { } } } catch (RuntimeException e) { - logger.error("IF 函数执行异常,异常信息:" + e); + logger.error("IF function execution exception, exception information:" + e.getMessage()); } return result; } |
