Hi everyone, I am trying to parse a json data to a plain text formatted to use it in an email alert.
Here is my JSON:
{
"DbMaintenanceDailyRoutineSummary": {
"success": [
{
"server-002": [
{
"vacuum": true,
"analyze": true,
"warehouse": "mydatabase@aaaaaa"
},
{
"vacuum": true,
"analyze": true,
"warehouse": "mydatabase@bbbbbb"
}
]
},
{
"server-003": [
{
"vacuum": true,
"analyze": true,
"warehouse": "mydatabase@ccccccc"
},
{
"vacuum": true,
"analyze": true,
"warehouse": "mydatabase@ddddddd"
}
]
}
],
"fail": [
{
"server-002": [
{
"vacuum": true,
"analyze": false,
"warehouse": "mydatabase@eeeeee"
}
]
},
{
"server-003": [
{
"vacuum": false,
"analyze": true,
"warehouse": "mydatabase@fffffff"
},
{
"vacuum": true,
"analyze": false,
"warehouse": "mydatabase@gggggg"
},
{
"vacuum": true,
"analyze": false,
"warehouse": "mydatabase@hhhhhh"
}
]
}
]
}
}
Can I convert that JSON in something like the following:
DbMaintenanceDailyRoutineSummary
fail:
server002:
mydatabase@eeeeee: analyze: false, vacuum: true
server003:
mydatabase@fffffff - analyze: false, vacuum: true
mydatabase@ggggg - analyze: false, vacuum: true
success:
server002:
mydatabase@aaaaaa- analyze: true, vacuum: true
mydatabase@bbbbbb - analyze: true, vacuum: true
server003:
mydatabase@ccccccc - analyze: false, vacuum: true
mydatabase@dddddd - analyze: false, vacuum: true
Any help appreciated.