I am trying to mask/hide a value of a field in a json file.
I have json that looks something like this:
"PLUSDATA": {
"global": {
"auth_type": "login",
"passkey": "SENSETIVE_CONTENT_TO_BE_HIDDEN",
"src_intf": "Loopback0",
"timeout": "5"
}
},
I’d like to parse my json and have the "SENSETIVE_CONTENT_TO_BE_HIDDEN" masked with * ( length does not matter
"PLUSDATA": {
"global": {
"auth_type": "login",
"passkey": "****",
"src_intf": "Loopback0",
"timeout": "5"
}
},
Thank you,
I am trying some variations of awk/sed but just can’t get the desired result.
2
Answers
I was able to get part of sed working when given a concrete line:
which parses it correctly.
But i can't seem to get the same result when doing something like: