log_profiles
Creates, updates, deletes, gets or lists a log_profiles resource.
Overview
| Name | log_profiles |
| Type | Resource |
| Id | azure.monitor.log_profiles |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
categories | array | the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'. Required. |
location | string | The geo-location where the resource lives. Required. |
locations | array | List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location. Required. |
retentionPolicy | object | the retention policy for the events in the log. Required. |
serviceBusRuleId | string | The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'. |
storageAccountId | string | the resource id of the storage account to which you would like to send the Activity Log. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
categories | array | the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'. Required. |
location | string | The geo-location where the resource lives. Required. |
locations | array | List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location. Required. |
retentionPolicy | object | the retention policy for the events in the log. Required. |
serviceBusRuleId | string | The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'. |
storageAccountId | string | the resource id of the storage account to which you would like to send the Activity Log. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | log_profile_name, subscription_id | Gets the log profile. | |
list | select | subscription_id | List the log profiles. | |
create_or_update | insert | log_profile_name, subscription_id, location, properties | Create or update a log profile in Azure Monitoring REST API. | |
update | update | log_profile_name, subscription_id | Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. | |
create_or_update | replace | log_profile_name, subscription_id, location, properties | Create or update a log profile in Azure Monitoring REST API. | |
delete | delete | log_profile_name, subscription_id | Deletes the log profile. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
log_profile_name | string | The name of the log profile. Required. |
subscription_id | string |
SELECT examples
- get
- list
Gets the log profile.
SELECT
id,
name,
categories,
location,
locations,
retentionPolicy,
serviceBusRuleId,
storageAccountId,
systemData,
tags,
type
FROM azure.monitor.log_profiles
WHERE log_profile_name = '{{ log_profile_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
List the log profiles.
SELECT
id,
name,
categories,
location,
locations,
retentionPolicy,
serviceBusRuleId,
storageAccountId,
systemData,
tags,
type
FROM azure.monitor.log_profiles
WHERE subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Create or update a log profile in Azure Monitoring REST API.
INSERT INTO azure.monitor.log_profiles (
tags,
location,
properties,
log_profile_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}' /* required */,
'{{ log_profile_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: log_profiles
props:
- name: log_profile_name
value: "{{ log_profile_name }}"
description: Required parameter for the log_profiles resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the log_profiles resource.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives. Required.
- name: properties
description: |
The log profile properties of the resource. Required.
value:
storageAccountId: "{{ storageAccountId }}"
serviceBusRuleId: "{{ serviceBusRuleId }}"
locations:
- "{{ locations }}"
categories:
- "{{ categories }}"
retentionPolicy:
enabled: {{ enabled }}
days: {{ days }}
UPDATE examples
- update
Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method.
UPDATE azure.monitor.log_profiles
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
log_profile_name = '{{ log_profile_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;
REPLACE examples
- create_or_update
Create or update a log profile in Azure Monitoring REST API.
REPLACE azure.monitor.log_profiles
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}'
WHERE
log_profile_name = '{{ log_profile_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
AND properties = '{{ properties }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;
DELETE examples
- delete
Deletes the log profile.
DELETE FROM azure.monitor.log_profiles
WHERE log_profile_name = '{{ log_profile_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;