[{"operation_time": "2025-04-12 15:32:01","user_info": "Zhang San applied to activate the service, ID number 522301199201230123","operation_detail": "Transaction amount: CNY 200"},{"operation_time": "2025-04-12 15:32:01","user_info": "Li Si applied to activate the service, ID number 522301199201230123, bank card number 6228880123456789123","operation_detail": "Transaction amount: CNY 100"},{"operation_time": "2025-04-12 15:32:01","user_info": "Wang Wu applied to activate the service, ID number 522***1992****0123, bank card number 6228****2345****123","operation_detail": "Transaction amount: CNY 500"}]
//scope=ALL_FIELDS means searching all fields in the entire log.//sample_ratio=1 means that all logs are scanned for sensitive information, while 0.5 means that 50% of the logs are scanned.sensitive_detection(scope="ALL_FIELDS", sample_ratio=1, discover_items="CHINA_IDCARD,DEBIT_CARD")
[//Only the ID number is flagged as a sensitive item in the first data record.{"SENSITIVE_FLAGS":"CHINA_IDCARD","operation_detail": "Transaction amount: CNY 200","operation_time":"2025-04-12 15:32:01","user_info": "Zhang San applied to activate the service, ID number 522301199201230123",},//The second data record contains two types of sensitive items: ID number and bank card number.{"SENSITIVE_FLAGS":"CHINA_IDCARD,DEBIT_CARD","operation_detail": "Transaction amount: CNY 100","operation_time":"2025-04-12 15:32:01","user_info": "Li Si applied to activate the service, ID number 522301199201230123, bank card number 6228880123456789123",},//The third data record is safe and is therefore marked as SAFE.{"SENSITIVE_FLAGS":"SAFE","operation_detail": "Transaction amount: CNY 500","operation_time":"2025-04-12 15:32:01","user_info": "Wang Wu applied to activate the service, ID number 522***1992****0123, bank card number 6228****2345****123",}]
selectcase whenSENSITIVE_FLAGS like '%CHINA_ID%'then 'ID Number Count'whenSENSITIVE_FLAGS like '%DEBIT_CARD%'then 'Bank Card Number Count' else 'other'end as type ,count(*) as "Sensitive Items"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"}
フィードバック