Skip to main content

data_sources

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

Overview

Namedata_sources
TypeResource
Idazure.log_analytics.data_sources

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.
etagstringThe ETag of the data source.
kindstringThe kind of the DataSource. Required. Known values are: "WindowsEvent", "WindowsPerformanceCounter", "IISLogs", "LinuxSyslog", "LinuxSyslogCollection", "LinuxPerformanceObject", "LinuxPerformanceCollection", "CustomLog", "CustomLogCollection", "AzureAuditLog", "AzureActivityLog", "GenericDataSource", "ChangeTrackingCustomPath", "ChangeTrackingPath", "ChangeTrackingServices", "ChangeTrackingDataTypeConfiguration", "ChangeTrackingDefaultRegistry", "ChangeTrackingRegistry", "ChangeTrackingLinuxPath", "LinuxChangeTrackingPath", "ChangeTrackingContentLocation", "WindowsTelemetry", "Office365", "SecurityWindowsBaselineConfiguration", "SecurityCenterSecurityWindowsBaselineConfiguration", "SecurityEventCollectionConfiguration", "SecurityInsightsSecurityEventCollectionConfiguration", "ImportComputerGroup", "NetworkMonitoring", "Itsm", "DnsAnalytics", "ApplicationInsights", and "SqlDataClassification". (WindowsEvent, WindowsPerformanceCounter, IISLogs, LinuxSyslog, LinuxSyslogCollection, LinuxPerformanceObject, LinuxPerformanceCollection, CustomLog, CustomLogCollection, AzureAuditLog, AzureActivityLog, GenericDataSource, ChangeTrackingCustomPath, ChangeTrackingPath, ChangeTrackingServices, ChangeTrackingDataTypeConfiguration, ChangeTrackingDefaultRegistry, ChangeTrackingRegistry, ChangeTrackingLinuxPath, LinuxChangeTrackingPath, ChangeTrackingContentLocation, WindowsTelemetry, Office365, SecurityWindowsBaselineConfiguration, SecurityCenterSecurityWindowsBaselineConfiguration, SecurityEventCollectionConfiguration, SecurityInsightsSecurityEventCollectionConfiguration, ImportComputerGroup, NetworkMonitoring, Itsm, DnsAnalytics, ApplicationInsights, SqlDataClassification)
propertiesobjectThe data source properties in raw json format, each kind of data source have it's own schema. Required.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, workspace_name, data_source_name, subscription_idGets a datasource instance.
list_by_workspaceselectresource_group_name, workspace_name, subscription_id, $filter$skiptokenGets the first page of data source instances in a workspace with the link to the next page.
create_or_updateinsertresource_group_name, workspace_name, data_source_name, subscription_id, properties, kindCreate or update a data source.
create_or_updatereplaceresource_group_name, workspace_name, data_source_name, subscription_id, properties, kindCreate or update a data source.
deletedeleteresource_group_name, workspace_name, data_source_name, subscription_idDeletes a data source instance.

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
$filterstringThe filter to apply on the operation. Required.
data_source_namestringName of the datasource. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
workspace_namestringThe name of the workspace. Required.
$skiptokenstringStarting point of the collection of data source instances. Default value is None.

SELECT examples

Gets a datasource instance.

SELECT
id,
name,
etag,
kind,
properties,
systemData,
tags,
type
FROM azure.log_analytics.data_sources
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND workspace_name = '{{ workspace_name }}' -- required
AND data_source_name = '{{ data_source_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create or update a data source.

INSERT INTO azure.log_analytics.data_sources (
properties,
etag,
kind,
tags,
resource_group_name,
workspace_name,
data_source_name,
subscription_id
)
SELECT
'{{ properties }}' /* required */,
'{{ etag }}',
'{{ kind }}' /* required */,
'{{ tags }}',
'{{ resource_group_name }}',
'{{ workspace_name }}',
'{{ data_source_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
kind,
properties,
systemData,
tags,
type
;

REPLACE examples

Create or update a data source.

REPLACE azure.log_analytics.data_sources
SET
properties = '{{ properties }}',
etag = '{{ etag }}',
kind = '{{ kind }}',
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND data_source_name = '{{ data_source_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND properties = '{{ properties }}' --required
AND kind = '{{ kind }}' --required
RETURNING
id,
name,
etag,
kind,
properties,
systemData,
tags,
type;

DELETE examples

Deletes a data source instance.

DELETE FROM azure.log_analytics.data_sources
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND data_source_name = '{{ data_source_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;