Share via


az iot du device log

Note

This reference is part of the azure-iot extension for the Azure CLI (version 2.46.0 or higher). The extension will automatically install the first time you run an az iot du device log command. Learn more about extensions.

Instance log collection management.

Commands

Name Description Type Status
az iot du device log collect

Configure a device diagnostics log collection operation on specified devices.

Extension GA
az iot du device log list

List instance diagnostic log collection operations.

Extension GA
az iot du device log show

Show a specific instance diagnostic log collection operation.

Extension GA

az iot du device log collect

Configure a device diagnostics log collection operation on specified devices.

az iot du device log collect --account
                             --agent-id
                             --instance
                             --lcid
                             [--description]
                             [--resource-group]

Examples

Configure diagnostics log collection for two devices d0 and d1.

az iot du device log collect -n {account_name} -i {instance_name} --log-collection-id {log_collection_id} --description "North-wing device diagnostics" --agent-id deviceId=d0 --agent-id deviceId=d1

Configure diagnostics log collection for a module m0 deployed on device d0.

az iot du device log collect -n {account_name} -i {instance_name} --log-collection-id {log_collection_id} --description "ML module diagnostics" --agent-id deviceId=d0 moduleId=m0

Required Parameters

--account -n

Device Update account name. You can configure the default account name using az config set defaults.adu_account={name}.

--agent-id

Space-separated key=value pairs corresponding to device update agent identifier properties. The key of deviceId is required, while moduleId is optional. --agent-id can be used 1 or more times.

--instance -i

Device Update instance name. You can configure the default instance name using az config set defaults.adu_instance={name}.

--lcid --log-collection-id

Log collection Id.

Optional Parameters

--description

Description for the log collection operation.

--resource-group -g

Device Update account resource group name. You can configure the default group using az config set defaults.adu_group={name}.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az iot du device log list

List instance diagnostic log collection operations.

az iot du device log list --account
                          --instance
                          [--resource-group]

Examples

List diagnostic log collection operations.

az iot du device log list -n {account_name} -i {instance_name}

Required Parameters

--account -n

Device Update account name. You can configure the default account name using az config set defaults.adu_account={name}.

--instance -i

Device Update instance name. You can configure the default instance name using az config set defaults.adu_instance={name}.

Optional Parameters

--resource-group -g

Device Update account resource group name. You can configure the default group using az config set defaults.adu_group={name}.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az iot du device log show

Show a specific instance diagnostic log collection operation.

az iot du device log show --account
                          --instance
                          --lcid
                          [--detailed {false, true}]
                          [--resource-group]

Examples

Show a diagnostic log collection operation.

az iot du device log show -n {account_name} -i {instance_name} --log-collection-id {log_collection_id}

Required Parameters

--account -n

Device Update account name. You can configure the default account name using az config set defaults.adu_account={name}.

--instance -i

Device Update instance name. You can configure the default instance name using az config set defaults.adu_instance={name}.

--lcid --log-collection-id

Log collection Id.

Optional Parameters

--detailed

Flag indicating whether the command should fetch the detailed status of a log collection operation.

Accepted values: false, true
--resource-group -g

Device Update account resource group name. You can configure the default group using az config set defaults.adu_group={name}.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.