@RapidJames Thank you for reaching out to Microsoft Q&A. Sorry for the delay in response. I would like to split the question into 2 parts. First is to capture APIM gateway logs and second, to send it to a custom endpoint.
Based on JSON format you described above; you were interested in capturing resource logs from APIM Gateway and check resource logs schema https://learn.microsoft.com/en-us/azure/api-management/gateway-log-schema-reference which provides info about all the fields logged. Resource logs (part of platform logs) are not collected until you configure it to route to any of the below destinations:
So, you need to configure gateway logs to any of the destinations above (refer to docs: https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=portal#create-diagnostic-settings for help in creating the docs) and resource logs will log JSON entry like below:
Second part: If you have already configured to send resource logs to any Azure resources or Azure Monitor partner solutions (https://learn.microsoft.com/en-us/azure/partner-solutions/overview) as above and looking for a solution to POST it to custom endpoint, then unfortunately you need to implement a custom solution to consume logs from that destination.
For example, you can use Azure Functions to read from Log Analytics via API https://learn.microsoft.com/en-us/rest/api/loganalytics/dataaccess/query/get and POST it to RESTful endpoint. If you need more info on any of the above approaches, feel free to reach out. I am happy to help!
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.