[{"operation_time": "2025-04-12 15:32:01","user_info": "张三申请开通服务,身份证号 522301199201230123","operation_detail": "成交金额200元"},{"operation_time": "2025-04-12 15:32:01","user_info": "李四申请开通服务,身份证号 522301199201230123,银行卡号 6228880123456789123","operation_detail": "成交金额100元"},{"operation_time": "2025-04-12 15:32:01","user_info": "王五申请开通服务,身份证号 522***1992****0123,银行卡号 6228****2345****123","operation_detail": "成交金额500元"}]
//scope=ALL_FIELDS 意为搜索整条日志中的所有字段//sample_ratio=1意为对所有的日志进行敏感信息检测,0.5代表对50%的日志进行检测sensitive_detection(scope="ALL_FIELDS", sample_ratio=1, discover_items="CHINA_IDCARD,DEBIT_CARD")
[//第一条数据中只有身份证敏感项{"SENSITIVE_FLAGS":"CHINA_IDCARD","operation_detail":"成交金额200元","operation_time":"2025-04-12 15:32:01","user_info":"张三申请开通服务,身份证号 522301199201230123"},//第二条数据中有身份证、银行卡两种敏感项{"SENSITIVE_FLAGS":"CHINA_IDCARD,DEBIT_CARD","operation_detail":"成交金额100元","operation_time":"2025-04-12 15:32:01","user_info":"李四申请开通服务,身份证号 522301199201230123,银行卡号 6228880123456789123"},//第三条数据是安全的, 因此标记为SAFE{"SENSITIVE_FLAGS":"SAFE","operation_detail":"成交金额500元","operation_time":"2025-04-12 15:32:01","user_info":"王五申请开通服务,身份证号 522***1992****0123,银行卡号 6228****2345****123"}]
selectcase whenSENSITIVE_FLAGS like '%CHINA_ID%'then '身份证个数'whenSENSITIVE_FLAGS like '%DEBIT_CARD%'then '银行卡个数' else 'other'end as type ,count(*) as "敏感项"group by type HAVING type != 'other'limit 10000

{"Id": "dev@12345","Ip": "11.111.137.225","phonenumber": "13912345678"}
fields_set("Id",regex_replace(v("Id"),regex="\\d{3}", replace="***",count=0))fields_set("Id",regex_replace(v("Id"),regex="\\S{2}", replace="**",count=1))fields_set("phonenumber",regex_replace(v("phonenumber"),regex="(\\d{0,3})\\d{4}(\\d{4})", replace="$1****$2"))fields_set("Ip",regex_replace(v("Ip"),regex="(\\d+\\.)\\d+(\\.\\d+\\.\\d+)", replace="$1***$2",count=0))
fields_set("Id",regex_replace(v("Id"),regex="\\d{3}", replace="***",count=0))
fields_set("Id",regex_replace(v("Id"),regex="\\S{2}", replace="**",count=1))
fields_set("phonenumber",regex_replace(v("phonenumber"),regex="(\\d{0,3})\\d{4}(\\d{4})", replace="$1****$2"))
fields_set("Ip",regex_replace(v("Ip"),regex="(\\d+\\.)\\d+(\\.\\d+\\.\\d+)", replace="$1***$2",count=0))
{"Id":"**v@***45","Ip":"11.***.137.225","phonenumber":"139****5678"}
文档反馈