Skip to content

Commit 6da873c

Browse files
committed
activity logs
1 parent e8dd304 commit 6da873c

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

[!NOTE]

Whitespace-only changes.

[!NOTE]git

Whitespace-only changes.

articles/azure-monitor/essentials/rest-api-walkthrough.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -539,30 +539,39 @@ Use the Azure Monitor REST API to query [activity log](/rest/api/monitor/activit
539539
```curl
540540
GET /subscriptions/<subscriptionId>/providers/Microsoft.Insights/eventtypes/management/values \
541541
?api-version=2015-04-01 \
542-
&$filter=<$filter> \
543-
&$select={$select}
542+
&$filter=<filter> \
543+
&$select=<select>
544544
host: management.azure.com
545545
```
546+
547+
**$filter** reduces the set of data collected.
548+
This argument is required and it also requires at least the start date/time.
549+
The $filter argument is very restricted and allows only the following patterns.
550+
- List events for a resource group: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq 'resourceGroupName'.
551+
- List events for resource: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq 'resourceURI'.
552+
- List events for a subscription in a time range: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.
553+
- List events for a resource provider: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.
554+
- List events for a correlation Id: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.
555+
556+
NOTE: No other syntax is allowed.
557+
558+
559+
**$select** is used to fetch events with only the given properties.
560+
The $select argument is a comma separated list of property names to be returned. Possible values are: authorization, claims, correlationId, description, eventDataId, eventName, eventTimestamp, httpRequest, level, operationId, operationName, properties, resourceGroupName, resourceProviderName, resourceId, status, submissionTimestamp, subStatus, subscriptionId
561+
546562
The following sample requests use the Azure Monitor REST API to query an activity log.
547563

548564
### Get activity logs with filter:
549565

550566
``` HTTP
551567
GET https://management.azure.com/subscriptions/12345678-abcd-98765432-abcdef012345/providers/microsoft.insights/eventtypes/management/values?api-version=2015-04-01&$filter=eventTimestamp ge '2023-03-21T20:00:00Z' and eventTimestamp le '2023-03-24T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'
552568
```
553-
554569
### Get activity logs with filter and select:
555570

556571
```HTTP
557572
GET https://management.azure.com/subscriptions/12345678-abcd-98765432-abcdef012345/providers/microsoft.insights/eventtypes/management/values?api-version=2015-04-01&$filter=eventTimestamp ge '2023-01-21T20:00:00Z' and eventTimestamp le '2023-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'&$select=eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level
558573
```
559574

560-
### Get activity logs with select:
561-
562-
```HTTP
563-
GET https://management.azure.com/subscriptions/12345678-abcd-98765432-abcdef012345/providers/microsoft.insights/eventtypes/management/values?api-version=2015-04-01&$select=eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level
564-
```
565-
566575

567576
## Troubleshooting
568577

0 commit comments

Comments
 (0)