Skip to main content

watchlists

Creates, updates, deletes, gets or lists a watchlists resource.

Overview

Namewatchlists
TypeResource
Idazure.security_insight.watchlists

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
contentTypestringThe content type of the raw content. Example : text/csv or text/tsv.
createdstring (date-time)The time the watchlist was created.
createdByobjectDescribes a user that created the watchlist.
defaultDurationstringThe default duration of a watchlist (in ISO 8601 duration format).
descriptionstringA description of the watchlist.
displayNamestringThe display name of the watchlist. Required.
etagstringEtag of the azure resource.
isDeletedbooleanA flag that indicates if the watchlist is deleted or not.
itemsSearchKeystringThe search key is used to optimize query performance when using watchlists for joins with other data. For example, enable a column with IP addresses to be the designated SearchKey field, then use this field as the key field when joining to other event data by IP address. Required.
labelsarrayList of labels relevant to this watchlist.
numberOfLinesToSkipintegerThe number of lines in a csv/tsv content to skip before the header.
providerstringThe provider of the watchlist. Required.
provisioningStatestringDescribes provisioning state. Known values are: "Accepted", "InProgress", "Succeeded", "Failed", and "Canceled". (Accepted, InProgress, Succeeded, Failed, Canceled)
rawContentstringThe raw content that represents to watchlist items to create. In case of csv/tsv content type, it's the content of the file that will parsed by the endpoint.
sourcestringThe filename of the watchlist, called 'source'.
sourceTypestringThe sourceType of the watchlist. Known values are: "Local" and "AzureStorage". (Local, AzureStorage)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tenantIdstringThe tenantId where the watchlist belongs to.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
updatedstring (date-time)The last time the watchlist was updated.
updatedByobjectDescribes a user that updated the watchlist.
uploadStatusstringThe status of the Watchlist upload : New, InProgress or Complete. Note
watchlistAliasstringThe alias of the watchlist.
watchlistIdstringThe id (a Guid) of the watchlist.
watchlistTypestringThe type of the watchlist.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, workspace_name, watchlist_alias, subscription_idGet a watchlist, without its watchlist items.
listselectresource_group_name, workspace_name, subscription_id$skipTokenGet all watchlists, without watchlist items.
create_or_updateinsertresource_group_name, workspace_name, watchlist_alias, subscription_idCreate or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv content type). To create a Watchlist and its Items, we should call this endpoint with rawContent and contentType properties.
create_or_updatereplaceresource_group_name, workspace_name, watchlist_alias, subscription_idCreate or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv content type). To create a Watchlist and its Items, we should call this endpoint with rawContent and contentType properties.
deletedeleteresource_group_name, workspace_name, watchlist_alias, subscription_idDelete a watchlist.

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.

NameDatatypeDescription
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
watchlist_aliasstringThe watchlist alias. Required.
workspace_namestringThe name of the monitor workspace. Required.
$skipTokenstringSkiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional. Default value is None.

SELECT examples

Get a watchlist, without its watchlist items.

SELECT
id,
name,
contentType,
created,
createdBy,
defaultDuration,
description,
displayName,
etag,
isDeleted,
itemsSearchKey,
labels,
numberOfLinesToSkip,
provider,
provisioningState,
rawContent,
source,
sourceType,
systemData,
tenantId,
type,
updated,
updatedBy,
uploadStatus,
watchlistAlias,
watchlistId,
watchlistType
FROM azure.security_insight.watchlists
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND workspace_name = '{{ workspace_name }}' -- required
AND watchlist_alias = '{{ watchlist_alias }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv content type). To create a Watchlist and its Items, we should call this endpoint with rawContent and contentType properties.

INSERT INTO azure.security_insight.watchlists (
properties,
etag,
resource_group_name,
workspace_name,
watchlist_alias,
subscription_id
)
SELECT
'{{ properties }}',
'{{ etag }}',
'{{ resource_group_name }}',
'{{ workspace_name }}',
'{{ watchlist_alias }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
properties,
systemData,
type
;

REPLACE examples

Create or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv content type). To create a Watchlist and its Items, we should call this endpoint with rawContent and contentType properties.

REPLACE azure.security_insight.watchlists
SET
properties = '{{ properties }}',
etag = '{{ etag }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND watchlist_alias = '{{ watchlist_alias }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
properties,
systemData,
type;

DELETE examples

Delete a watchlist.

DELETE FROM azure.security_insight.watchlists
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND watchlist_alias = '{{ watchlist_alias }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;