Created
July 19, 2021 07:06
-
-
Save easonlai/fe8f55e209f64b6e8ea36384f3e2ffde to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define the variables | |
$log_Analytics_Workspace_Resource_Group_Name = 'PLEASE_ENTER_YOUR_OWNED_LOG_ANALYTICS_WORKSPACE_RESOURCE_GROUP_NAME' | |
$log_Analytics_Workspace_Name = 'PLEASE_ENTER_YOUR_OWNED_LOG_ANALYTICS_WORKSPACE_NAME' | |
$log_Analytics_Export_Rule_Name = 'PLEASE_ENTER_RULE_NAME_TO_BE_CREATE' | |
$storageAccountResourceId = 'PLEASE_ENTER_YOUR_OWNED_BLOB_STORAGE_RESOURCE_PROPERTIES' | |
# Create new rule for Log Analytics export Container Insight and AKS related logs into Blob Storage | |
az monitor log-analytics workspace data-export create --resource-group $log_Analytics_Workspace_Resource_Group_Name --workspace-name $log_Analytics_Workspace_Name --name dnilaw01tostore01 --tables Heartbeat ContainerInventory ContainerImageInventory ContainerLog ContainerLogV2 ContainerNodeInventory ContainerServiceLog KubeEvents KubeHealth KubeMonAgentEvents KubeNodeInventory KubePodInventory KubeServices --destination $storageAccountResourceId | |
# Check newly created export rule | |
az monitor log-analytics workspace data-export show --resource-group $log_Analytics_Workspace_Resource_Group_Name --workspace-name $log_Analytics_Workspace_Name --name $log_Analytics_Export_Rule_Name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment