weixin_43113933 2021-11-24 10:18 采纳率: 58.3%
浏览 53

求解组会任务,如何给原始json日志脱敏?

求解方案,就是对原始json的数据进行脱敏,在原始json的基础上对用户名,邮箱,手机号等信息脱敏,数据量很大,求解可行的解决方案
,类似以下这种json数据,数据已经过处理.

{
    "_id": {
        "$oid": "5ef1d16a8f35080030d9ca0b"
    },
    "hasGeneratedId": true,
    "organisation": {
        "$oid": "5ef1d02f924838008888a688"
    },
    "lrs_id": {
        "$oid": "5ef1d12314e1340047ee4774"
    },
    "client": {
        "$oid": "5ef1d12314e1340047ee4775"
    },
    "person": null,
    "active": true,
    "voided": false,
    "timestamp": {
        "$date": "2020-06-23T09:54:50.788Z"
    },
    "stored": {
        "$date": "2020-06-23T09:54:50.788Z"
    },
    "hash": "c37991d63bd850eaa53debcb034a5ecb",
    "agents": ["mailto:aaaGroup@sina.net"],
    "relatedAgents": ["mailto:aaaaGroup@sina.net", "mailto:rfr@nercel.com"],
    "registrations": [],
    "verbs": ["http://experienced/"],
    "activities": ["http://rfgdfsoftggre.github.io/TinCan.NET"],
    "relatedActivities": ["http://rjjcisoggware.github.io/TinCan.NET"],
    "statement": {
        "actor": {
            "objectType": "Group",
            "name": "IcsyGroup-A1",
            "mbox": "mailto:pppGroup@sina.net"
        },
        "verb": {
            "id": "http://experienced/",
            "display": {
                "en-US": "experienced-2"
            }
        },
        "object": {
            "objectType": "Activity",
            "id": "http://russoftware.github.io/TinCan.NET",
            "definition": {
                "type": "https://www.stac.com.cn/xapi/testType",
                "name": {
                    "en-US": "(测试) : op时间"
                },
                "description": {
                    "zh-CN": "Details:授课时间为40分钟。"
                }
            }
        },
        "result": {
            "completion": true,
            "success": true,
            "response": "the response is test response"
        },
        "version": "1.0.1",
        "id": "36faed34-820d-5555-a0d9-ad88d8c88245",
        "timestamp": "2020-06-23T09:54:50.788Z",
        "stored": "2020-06-23T09:54:50.788Z",
        "authority": {
            "objectType": "Agent",
            "name": "a New Client",
            "mbox": "mailto:ooon@nercel.com"
        }
    },
    "processingQueues": [],
    "completedQueues": ["STATEMENT_PERSON_QUEUE", "STATEMENT_QUERYBUILDERCACHE_QUEUE", "STATEMENT_FORWARDING_QUEUE"]
}

  • 写回答

2条回答 默认 最新

  • 关注

    大概就是自定义一个序列化类,通过键来判断一下要不要就值进行特殊处理,希望对你有帮助

    class MyStringSerializer extends JsonSerializer<String> {
    
        @Override
        public void serialize(String s, JsonGenerator jgen, SerializerProvider serializerProvider) throws IOException {
            String currentName = jgen.getOutputContext().getCurrentName();
            if ("就是它".equals(currentName)) {
                jgen.writeString(s + "骚操作");
            }else{
                jgen.writeString(s);
            }
        }
    }
    
    
    评论

报告相同问题?

问题事件

  • 创建了问题 11月24日

悬赏问题

  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程