Query logs from Start/Stop VMs during off-hours
Azure Automation forwards two types of records to the linked Log Analytics workspace: job logs and job streams. This article reviews the data available for query in Azure Monitor.
Job logs
| Property | Description |
|---|---|
| Caller | Who initiated the operation. Possible values are either an email address or system for scheduled jobs. |
| Category | Classification of the type of data. For Automation, the value is JobLogs. |
| CorrelationId | GUID that is the Correlation ID of the runbook job. |
| JobId | GUID that is the ID of the runbook job. |
| operationName | Specifies the type of operation performed in Azure. For Automation, the value is Job. |
| resourceId | Specifies the resource type in Azure. For Automation, the value is the Automation account associated with the runbook. |
| ResourceGroup | Specifies the resource group name of the runbook job. |
| ResourceProvider | Specifies the Azure service that supplies the resources you can deploy and manage. For Automation, the value is Azure Automation. |
| ResourceType | Specifies the resource type in Azure. For Automation, the value is the Automation account associated with the runbook. |
| resultType | The status of the runbook job. Possible values are: - Started - Stopped - Suspended - Failed - Succeeded |
| resultDescription | Describes the runbook job result state. Possible values are: - Job is started - Job Failed - Job Completed |
| RunbookName | Specifies the name of the runbook. |
| SourceSystem | Specifies the source system for the data submitted. For Automation, the value is OpsManager |
| StreamType | Specifies the type of event. Possible values are: - Verbose - Output - Error - Warning |
| SubscriptionId | Specifies the subscription ID of the job. |
| Time | Date and time when the runbook job executed. |
Job streams
| Property | Description |
|---|---|
| Caller | Who initiated the operation. Possible values are either an email address or system for scheduled jobs. |
| Category | Classification of the type of data. For Automation, the value is JobStreams. |
| JobId | GUID that is the ID of the runbook job. |
| operationName | Specifies the type of operation performed in Azure. For Automation, the value is Job. |
| ResourceGroup | Specifies the resource group name of the runbook job. |
| resourceId | Specifies the resource ID in Azure. For Automation, the value is the Automation account associated with the runbook. |
| ResourceProvider | Specifies the Azure service that supplies the resources you can deploy and manage. For Automation, the value is Azure Automation. |
| ResourceType | Specifies the resource type in Azure. For Automation, the value is the Automation account associated with the runbook. |
| resultType | The result of the runbook job at the time the event was generated. A possible value is: - InProgress |
| resultDescription | Includes the output stream from the runbook. |
| RunbookName | The name of the runbook. |
| SourceSystem | Specifies the source system for the data submitted. For Automation, the value is OpsManager. |
| StreamType | The type of job stream. Possible values are: - Progress - Output - Warning - Error - Debug - Verbose |
| Time | Date and time when the runbook job executed. |
When you perform any log search that returns category records of JobLogs or JobStreams, you can select the JobLogs or JobStreams view, which displays a set of tiles summarizing the updates returned by the search.
Sample log searches
The following table provides sample log searches for job records collected by Start/Stop VMs during off-hours.
| Query | Description |
|---|---|
| Find jobs for runbook ScheduledStartStop_Parent that have finished successfully | search Category == "JobLogs" |
| Find jobs for runbook ScheduledStartStop_Parent that have not completed successfully | search Category == "JobLogs" |
| Find jobs for runbook SequencedStartStop_Parent that have finished successfully | search Category == "JobLogs" |
| Find jobs for runbook SequencedStartStop_Parent that have not completed successfully | search Category == "JobLogs" |
Next steps
- To set up the feature, see Configure Stop/Start VMs during off-hours.
- For information on log alerts during feature deployment, see Create log alerts with Azure Monitor.
- To resolve feature errors, see Troubleshoot Start/Stop VMs during off-hours issues.
Povratne informacije
Pošalјite i prikažite povratne informacije za