Is there any way we can deploy azure DCR with two or more log analytics workspace destinations?
I have Tried basic code with one destination but I am not able to add another one
resource "azurerm_monitor_data_collection_rule" "this" {
name = local.naming.dcr_name
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
destinations {
**log_analytics {
workspace_resource_id = azurerm_log_analytics_workspace.this.id
name = local.naming.log_name
}**
}
data_flow {
streams = ["Microsoft-Table-Perf"]
destinations = [local.naming.log_name]
}
}
2
Answers
I used the below terraform code to create a
DCR
rule and associate it with twolog analytics workspaces
.After running the code, a
DCR
was created with twolog analytics workspaces
.Can we send syslog to two different workspaces? I can manually add two or more workspace but how will it work using terraform?