Forum Discussion
khmi905
Aug 23, 2024Copper Contributor
REST endpoint for querying in log traces (kusto based)
Do anyone here know if there exists a REST endpoint for querying in log traces (kusto based) like this sample: traces | where timestamp > ago(60m) | parse message with xx "instance=" instance "...
sdtslmn
Aug 23, 2024MCT
you can execute Kusto queries programmatically using the Azure Data Explorer (ADX) REST API.
here are your parameters
endpoint: https://<clusterName>.<region>.kusto.windows.net/v1/rest/query
HTTP Request:
- Method: POST
- Headers
- Authorization: Bearer <your-access-token>
- Content-Type: application/json
- Body
{
"db": "<your-database-name>",
"csl": "traces | where timestamp > ago(60m) | parse message with xx 'instance=' instance ',' yy | summarize ['instances'] = dcount(instance) by bin(timestamp, 60sec)"
}