Support Questions

Find answers, ask questions, and share your expertise

How to replace a Jason attribute value using NIFI

avatar
Explorer

I have to migrate data from Prod to test .But, My prod data has sensitive information in the Json file. I want to replace values of dozen sensitive fields with random data. How can I accomplish that using NIFI

For example the following SSN value should be replaced with 11111, etc

,"ssn":"5010040000022626666666",

"name":"john" should be replaced with bob , etc

Your help is appreciated

Thanks

13 REPLIES 13

avatar
Master Guru

@Sudheer K

We need to configure demarcator as newline (i.e shift+enter or \n)

Merge Content Configs:

84399-mergecontent.png

avatar
Explorer

Thanks @Shu . For some reason, I was earlier caught up that some text needs to be entered.It didn't strike in my mid that an empty line can be used. I tried above and it works totally fine. Thanks a Lot.You are awesome

avatar
Explorer

Thanks @Shu for promptly responding. My issue is slightly different

It has various records in the same file because merging few Json files. For example,

[{"account":{"id":1}},{"account":{"id":2}}]

[{"account":{"id":3}},{"account":{"id":4}}]

[{"account":{"id":5}},{"account":{"id":6}}]

It works for the first line 1,2 but not for 3,4 ,5,6.

Appreciate your helpcapture.jpg. Screenshot attached as well

capture.jpg

avatar
Explorer

Thanks @Shu for promptly responding. My issue is slightly different.

I have number of records (10) in the same file due to mergeJson for example,My file has

[{"account":{"id":1}},{"account":{"id":2}}]

[{"account":{"id":3}},{"account":{"id":4}}]

[{"account":{"id":5}},{"account":{"id":6}}]

It replace 1,2 succesfully but not 3,4,5,5
Please assist. Thanks in advance