JSON Code – Auditlog Data

Copy
{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Call_ABR_Sentinel_API": {
                "inputs": {
                    "body": {
                        "ApiKey": "@{parameters('ApiKey')}",
                        "Ticks": "@variables('deltaTime')"
                    },
                    "method": "POST",
                    "uri": "https://sentinel.adminbyrequest.com/Audit/SetDeltaTime"
                },
                "runAfter": {
                    "Initialize_deltaTime_variable": [
                        "Succeeded"
                    ]
                },
                "type": "Http"
            },
            "Call_the_ABR_Audit_API": {
                "inputs": {
                    "headers": {
                        "apikey": "@parameters('ApiKey')"
                    },
                    "method": "GET",
                    "uri": "https://dc1api.adminbyrequest.com/auditlog/delta?deltaTime=@{variables('newDeltaTime')}"
                },
                "runAfter": {
                    "Initialize_newDeltaTime_variable": [
                        "Succeeded"
                    ]
                },
                "type": "Http"
            },
            "Initialize_deltaTime_variable": {
                "inputs": {
                    "variables": [
                        {
                            "name": "deltaTime",
                            "type": "integer",
                            "value": "@ticks(utcNow())"
                        }
                    ]
                },
                "runAfter": {},
                "type": "InitializeVariable"
            },
            "Initialize_newDeltaTime_variable": {
                "inputs": {
                    "variables": [
                        {
                            "name": "newDeltaTime",
                            "type": "integer",
                            "value": "@body('Call_ABR_Sentinel_API')"
                        }
                    ]
                },
                "runAfter": {
                    "Call_ABR_Sentinel_API": [
                        "Succeeded"
                    ]
                },
                "type": "InitializeVariable"
            },
            "Loop_entries": {
                "actions": {},
                "foreach": "@body('Parse_JSON')?['entries']",
                "runAfter": {
                    "Parse_JSON": [
                        "Succeeded"
                    ]
                },
                "type": "Foreach"
            },
            "Parse_JSON": {
                "inputs": {
                    "content": "@body('Call_the_ABR_Audit_API')",
                    "schema": {
                        "properties": {
                            "entries": {
                                "items": {
                                    "properties": {
                                        "application": {
                                            "properties": {
                                                "file": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "preapproved": {
                                                    "type": "boolean"
                                                },
                                                "scanResult": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "scanResultCode": {
                                                    "type": "integer"
                                                },
                                                "sha256": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "threat": {},
                                                "vendor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "version": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "virustotalLink": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "approvedBy": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "auditlogLink": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "computer": {
                                            "properties": {
                                                "make": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "model": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "platform": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "platformCode": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "deniedBy": {},
                                        "deniedReason": {},
                                        "elevatedApplications": {
                                            "items": {
                                                "properties": {
                                                    "file": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "name": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "path": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "scanResult": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "scanResultCode": {
                                                        "type": "integer"
                                                    },
                                                    "sha256": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "threat": {},
                                                    "vendor": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "version": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "virustotalLink": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "name",
                                                    "path",
                                                    "file",
                                                    "version",
                                                    "vendor",
                                                    "sha256",
                                                    "scanResult",
                                                    "scanResultCode",
                                                    "threat",
                                                    "virustotalLink"
                                                ],
                                                "type": "object"
                                            },
                                            "type": "array"
                                        },
                                        "endTime": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "endTimeUTC": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "id": {
                                            "type": "integer"
                                        },
                                        "installs": {
                                            "items": {
                                                "properties": {
                                                    "application": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "vendor": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "version": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "application",
                                                    "version",
                                                    "vendor"
                                                ],
                                                "type": "object"
                                            },
                                            "type": "array"
                                        },
                                        "reason": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "requestTime": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "requestTimeUTC": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "responseTime": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "scanResults": {
                                            "items": {
                                                "properties": {
                                                    "engine": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "scanResult": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "scanResultCode": {
                                                        "type": "integer"
                                                    },
                                                    "threat": {}
                                                },
                                                "required": [
                                                    "scanResult",
                                                    "scanResultCode",
                                                    "engine",
                                                    "threat"
                                                ],
                                                "type": "object"
                                            },
                                            "type": "array"
                                        },
                                        "settingsName": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "startTime": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "startTimeUTC": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "status": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "statusCode": {
                                            "type": "integer"
                                        },
                                        "traceNo": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "type": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "typeCode": {
                                            "type": "integer"
                                        },
                                        "uninstalls": {
                                            "items": {
                                                "properties": {
                                                    "application": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "vendor": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "version": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "application",
                                                    "version",
                                                    "vendor"
                                                ],
                                                "type": "object"
                                            },
                                            "type": "array"
                                        },
                                        "user": {
                                            "properties": {
                                                "account": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "email": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "fullName": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "phone": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "required": [
                                        "id",
                                        "traceNo",
                                        "settingsName",
                                        "type",
                                        "typeCode",
                                        "status",
                                        "statusCode",
                                        "reason",
                                        "approvedBy",
                                        "deniedReason",
                                        "deniedBy",
                                        "requestTime",
                                        "requestTimeUTC",
                                        "startTime",
                                        "startTimeUTC",
                                        "endTime",
                                        "endTimeUTC",
                                        "responseTime",
                                        "auditlogLink",
                                        "user",
                                        "computer",
                                        "application",
                                        "installs",
                                        "uninstalls",
                                        "elevatedApplications",
                                        "scanResults"
                                    ],
                                    "type": "object"
                                },
                                "type": "array"
                            },
                            "timeNow": {
                                "type": "integer"
                            }
                        },
                        "type": "object"
                    }
                },
                "runAfter": {
                    "Call_the_ABR_Audit_API": [
                        "Succeeded"
                    ]
                },
                "type": "ParseJson"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {
            "ApiKey": {
                "defaultValue": "xxxxxx",
                "type": "String"
            },
            "LogName": {
                "defaultValue": "AdminByRequestLogs",
                "type": "String"
            }
        },
        "triggers": {
            "Recurrence": {
                "evaluatedRecurrence": {
                    "frequency": "Day",
                    "interval": 1,
                    "startTime": "2022-06-22T15:00:00Z"
                },
                "recurrence": {
                    "frequency": "Day",
                    "interval": 1,
                    "startTime": "2022-06-22T15:00:00Z"
                },
                "type": "Recurrence"
            }
        }
    },
    "parameters": {}
}