Hi there,
My goal is to parse a blob file as it is added to a storage account, then alert if the value of
Per the references below, I have tried converting the object by using the Initialize Variable, Compose, and Select operations, both inside and outside of a For Each Loop.
Sample of Parse JSON schema:
{
"properties": {
......
},
"alerts": {
"items": {
"properties": {
......
"riskdesc": {
"type": [
"string",
"null"
]
},
......
},
"type": "array"
},
"type": "array"
}
},
"type": "object"
}
I have attached screenshots of the flow and my most recent run logic.
Please let me know if I can clarify anything here. Any help would be greatly appreciated!
References:
https://pacodelacruzag.wordpress.com/2017/05/18/transforming-json-objects-in-logic-apps/
You could probably just grab the alerts directly without using the parseJson action, @Anonymous 🙂 ... not going to get deeply into here, but you could try something like the following wherever it is needed.
Just use the name of whatever action you have the Parse JSON action running off of and you will possibly get the alerts:
@body('NAME_OF_THE_ACTION_THAT_PARSE_JSON_IS_FEEDING_FROM')?['alerts']
Obviously I don't know the action name, and I cannot download files to look at them (always good to embed screenshots), but yeah ... it might be easier here. If you are going to type the action name in there yourself, just remember to use underscores where the spaces are.
So 'Get items' becomes 'Get_items' ... etc.
You want to access „@body('Parse_JSON')?['alerts']…“
As you can see from your previous post „alerts“ is inside of a „site“ array. The parse json scheme you provided doesn’t show that so how did you create it or what are you parsing.
The dynamic content from parse json doesn’t care about the actual content. In fact it doesn’t know it. It just provides it because you provide a schema.
Hi @Matthy79,
Thank you for checking this out and proving the coalesce suggestion. I will try this next. However, "alerts" is definitely in the provided JSON. It also suggests it as dynamic content under the Parse JSON step. Maybe I am just accessing it incorrectly?
This is a snippet of one the of entries that the LA is parsing:
{
"@programName": "ZAP",
"@version": "2.14.0",
"@generated": "Thu, 2 Nov 2023 21:15:24",
"site": [
{
"@name": "*********************",
"@host": "*********************",
"@port": "443",
"@ssl": "true",
"alerts": [
{
"pluginid": "10202",
"alertRef": "10202",
"alert": "Absence of Anti-CSRF Tokens",
"name": "Absence of Anti-CSRF Tokens",
"riskcode": "2",
"confidence": "1",
"riskdesc": "Medium (Low)",
"desc": "",
"instances": [
{
"uri": "*********************",
"method": "GET",
"param": "",
"attack": "",
"evidence": "",
"otherinfo": ""
}
],
"count": "9",
"solution": "",
"otherinfo": "",
"reference": "",
"cweid": "352",
"wascid": "9",
"sourceid": "50"
}
]
}
]
}
It looks like „alerts“ is not part of the JSON you received. Have you checked that? If it is sometimes there and sometimes not you can use coalesce.
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2