Qué vas a conseguir
Un área de trabajo de Log Analytics que recibe los datos de tus servidores, en Azure y en el CPD, con reglas que dicen exactamente qué se recoge. Las consultas KQL que usas a diario, una alerta que llega al equipo de guardia y no al buzón de nadie, una factura que entiendes por tabla, y el procedimiento para cuando un servidor deja de aparecer.
Antes de empezar
- Una suscripción para la monitorización y el rol Monitoring Contributor (alertas y reglas) y Log Analytics Contributor (área de trabajo) sobre su grupo de recursos.
- Para los servidores locales, salida HTTPS (443) hacia los puntos de conexión de Azure Arc y de Azure Monitor, directa o por proxy.
- El agente de Log Analytics (MMA/OMS) está retirado desde agosto de 2024. Si aún queda alguno, la migración al agente de Azure Monitor va antes que cualquier otra cosa de esta guía.
1. Un área de trabajo, no veinte
La regla general es una área de trabajo por región de datos, no una por equipo ni por aplicación.
- Acceso: con el modo usar permisos de recurso o de área de trabajo, quien tiene acceso a una VM ve sus registros sin ver los de las demás. Para tablas delicadas existe RBAC por tabla.
- Cuándo separar: datos que por ley deben quedarse en otra región, otro tenant, o la decisión de no mezclar con Sentinel. Si Sentinel está activado en un área de trabajo, cobra sobre los datos facturables de esa área; muchos equipos dejan los contadores de rendimiento en un área de operaciones aparte por ese motivo.
2. El agente y las reglas de recopilación
El agente de Azure Monitor (AMA) no tiene configuración propia: recoge lo que dicen las reglas de recopilación de datos (DCR) asociadas a la máquina. Una máquina puede tener varias reglas; una regla puede aplicarse a cientos de máquinas.
- Los eventos van a la tabla
Event, los contadores aPerfy el syslog de Linux aSyslog(con su propia regla:auth,daemonykerndesde Warning suele bastar). Los eventos de seguridad de Windows van aSecurityEventy se configuran desde el conector de Sentinel. - La regla admite XPath para afinar:
System!*[System[(Level=1 or Level=2)]]deja solo críticos y errores. - El agente se instala como extensión (
AzureMonitorWindowsAgent/AzureMonitorLinuxAgent). Al asociar una regla desde el portal, la extensión se instala sola; a escala, se asigna la iniciativa de Azure Policy que instala el agente y asocia la regla a todo lo nuevo.
3. Los servidores del CPD con Azure Arc
Un servidor local no puede tener la extensión del agente sin existir antes en Azure. Azure Arc (agente Connected Machine, azcmagent) lo convierte en un recurso de Azure con identidad administrada, etiquetas, políticas y extensiones.
- En Azure Arc › Máquinas › Agregar o crear, genera el script para varios servidores con una entidad de servicio que solo tenga el rol Azure Connected Machine Onboarding en
rg-arc-cpd. - Si hay proxy, configúralo antes de conectar:
azcmagent config set proxy.url "http://proxy.contoso.local:8080". - Ejecuta
azcmagent checkpara probar los puntos de conexión y despliega el script con MECM, GPO o Ansible. - Cuando el servidor aparece como Conectado, la iniciativa de Azure Policy instala el agente y le asocia
dcr-windows-base.
4. Las consultas de cada día
# Quién ha dejado de informar en los últimos 15 minutosHeartbeat| summarize Ultimo = max(TimeGenerated) by Computer, ComputerEnvironment| where Ultimo < ago(15m)Computer ComputerEnvironment Ultimosrv-file02 Non-Azure 28/10/2026 06:41srv-print01 Non-Azure 27/10/2026 22:03# Discos con menos del 10 % librePerf| where TimeGenerated > ago(1h) and ObjectName == "LogicalDisk" and CounterName == "% Free Space" and InstanceName != "_Total"| summarize Libre = round(min(CounterValue), 1) by Computer, InstanceName| where Libre < 10Computer InstanceName Libresrv-sql03 E: 6.4srv-app07 D: 8.9Eventresponde a "¿qué pasó en esta máquina anoche?":Event | where Computer == "srv-app07" and EventLevelName == "Error" | summarize count() by Source, EventID.
5. Una alerta que llega a alguien
- Dividir por
Computergenera una alerta por servidor, con su nombre en el aviso, en lugar de un único "hay servidores caídos". - El grupo de acciones se reutiliza en todas las reglas: notificación al buzón compartido, webhook a la herramienta de tickets o una aplicación lógica que publica en Teams. Nunca el correo personal de quien creó la regla.
- Para las ventanas de mantenimiento, una regla de procesamiento de alertas suprime las notificaciones de un grupo de recursos durante el horario del cambio, sin desactivar las reglas.
6. Retención y coste
- La retención analítica por defecto es de 30 días (31 incluidos en el precio de ingesta). Por tabla puedes ampliarla hasta dos años y añadir retención a largo plazo hasta 12 años, consultable con trabajos de búsqueda.
- Planes por tabla: Analytics para lo que alimenta alertas y paneles, Basic para lo que se consulta en una investigación, Auxiliary para registros verbosos de auditoría. Las alertas dejan de funcionar en una tabla Auxiliary.
Usage | where IsBillable | summarize GB = sum(Quantity) / 1000 by DataTypedice qué tabla pesa. Lo habitual: contadores cada 10 segundos o Información en todos los registros de eventos. Se corrige en la regla, no en el área de trabajo.- Un límite diario evita sorpresas, pero al alcanzarlo deja de entrar todo, alertas incluidas. Úsalo como red de seguridad con un umbral alto y una alerta al 80 %.
7. El ticket: "srv-file02 ha dejado de enviar datos"
La alerta de latido salta a las 06:51. El servidor responde al ping y los usuarios abren sus carpetas.
- ¿Desde cuándo? La consulta de
Heartbeatdice 06:41. Si el resto de servidores de la sede también calla, es la red o el proxy, no la máquina. - ¿Arc está conectado?
azcmagent showResource Name : srv-file02Resource Group Name : rg-arc-cpdAgent Status : ConnectedAgent Last Heartbeat : 2026-10-28T07:02:14ZUsing HTTPS Proxy : http://proxy.contoso.local:8080Dependent Service Status Agent Service (himds) : running Extension Service (extensionservice) : running GC Service (gcarcservice) : runningaz monitor data-collection rule association list --resource "/subscriptions/<id>/resourceGroups/rg-arc-cpd/providers/Microsoft.HybridCompute/machines/srv-file02" --query "[].name" -o tsv# Sin resultados: el servidor no tiene ninguna regla asociada- ¿El agente está instalado y vivo? En Extensiones del servidor Arc,
AzureMonitorWindowsAgentdebe estar en Correcto, y el procesoMonAgentCore.exeen ejecución. Los registros de la extensión están enC:\ProgramData\GuestConfig\extension_logs\Microsoft.Azure.Monitor.AzureMonitorWindowsAgent. - ¿Tiene regla asociada? Aquí estaba el fallo: la noche anterior se recreó
dcr-windows-basecon otro ámbito y srv-file02 quedó fuera. Sin regla, el agente no tiene nada que enviar, ni siquiera el latido. Se vuelve a asociar y el latido aparece en unos minutos. - Si la regla está bien, mira la red: el agente necesita
global.handler.control.monitor.azure.com,westeurope.handler.control.monitor.azure.comy<id-del-área>.ods.opinsights.azure.com, sin inspección TLS. Recuerda que la extensión del agente puede no heredar el proxy de Arc: tiene su propia configuración de proxy.
Cierra el ticket con la causa y la prevención: las asociaciones las gestiona Azure Policy, no el portal a mano.
Siguientes pasos
- La guía de Microsoft Sentinel usa esta misma área de trabajo para la seguridad: conectores, reglas en KQL e incidentes.
- La guía de Terraform para declarar áreas de trabajo, reglas de recopilación y alertas como código.
- La guía de Backup y DR/BCP: la alerta de trabajos de copia fallidos es la siguiente que merece una regla.
¿Falta algo o en tu entorno es distinto? Escríbeme y lo corrijo.
What you'll get
A Log Analytics workspace that receives data from your servers, in Azure and in the data centre, with rules that state exactly what is collected. The KQL queries you use every day, an alert that reaches the on-call team rather than someone's inbox, a bill you understand per table, and the procedure for when a server stops showing up.
Before you start
- A subscription for monitoring, and the Monitoring Contributor (alerts and rules) and Log Analytics Contributor (workspace) roles on its resource group.
- For on-prem servers, outbound HTTPS (443) to the Azure Arc and Azure Monitor endpoints, direct or through a proxy.
- The Log Analytics agent (MMA/OMS) has been retired since August 2024. If any are left, migrating them to the Azure Monitor agent comes before anything else in this guide.
1. One workspace, not twenty
The general rule is one workspace per data region, not one per team or per application.
- Access: with the use resource or workspace permissions mode, whoever has access to a VM sees its logs without seeing the others'. For sensitive tables there is table-level RBAC.
- When to split: data that must legally stay in another region, another tenant, or the decision not to mix with Sentinel. If Sentinel is enabled on a workspace, it charges on that workspace's billable data; many teams keep performance counters in a separate operations workspace for that reason.
2. The agent and the collection rules
The Azure Monitor agent (AMA) has no configuration of its own: it collects what the data collection rules (DCRs) associated with the machine say. A machine can have several rules; a rule can apply to hundreds of machines.
- Events go to the
Eventtable, counters toPerfand Linux syslog toSyslog(with its own rule:auth,daemonandkernfrom Warning up is usually enough). Windows security events go toSecurityEventand are configured from the Sentinel connector. - The rule accepts XPath for finer control:
System!*[System[(Level=1 or Level=2)]]keeps only critical and error events. - The agent is installed as an extension (
AzureMonitorWindowsAgent/AzureMonitorLinuxAgent). When you associate a rule from the portal, the extension installs itself; at scale, assign the Azure Policy initiative that installs the agent and associates the rule with everything new.
3. Data centre servers with Azure Arc
An on-prem server can't get the agent extension without first existing in Azure. Azure Arc (Connected Machine agent, azcmagent) turns it into an Azure resource with a managed identity, tags, policies and extensions.
- In Azure Arc › Machines › Add/Create, generate the script for multiple servers with a service principal that only has the Azure Connected Machine Onboarding role on
rg-arc-dc. - If there is a proxy, configure it before connecting:
azcmagent config set proxy.url "http://proxy.contoso.local:8080". - Run
azcmagent checkto test the endpoints, and deploy the script with MECM, GPO or Ansible. - Once the server shows as Connected, the Azure Policy initiative installs the agent and associates
dcr-windows-base.
4. The everyday queries
# Who has stopped reporting in the last 15 minutesHeartbeat| summarize LastSeen = max(TimeGenerated) by Computer, ComputerEnvironment| where LastSeen < ago(15m)Computer ComputerEnvironment LastSeensrv-file02 Non-Azure 28/10/2026 06:41srv-print01 Non-Azure 27/10/2026 22:03# Disks with less than 10% freePerf| where TimeGenerated > ago(1h) and ObjectName == "LogicalDisk" and CounterName == "% Free Space" and InstanceName != "_Total"| summarize Free = round(min(CounterValue), 1) by Computer, InstanceName| where Free < 10Computer InstanceName Freesrv-sql03 E: 6.4srv-app07 D: 8.9Eventanswers "what happened on this machine last night?":Event | where Computer == "srv-app07" and EventLevelName == "Error" | summarize count() by Source, EventID.
5. An alert that reaches someone
- Splitting by
Computerraises one alert per server, with its name in the notification, instead of a single "some servers are down". - The action group is reused across all rules: a notification to the shared mailbox, a webhook to the ticketing tool, or a Logic App that posts to Teams. Never the personal mailbox of whoever created the rule.
- For maintenance windows, an alert processing rule suppresses notifications for a resource group during the change, without disabling the rules.
6. Retention and cost
- Default analytics retention is 30 days (31 included in the ingestion price). Per table you can extend it to two years and add long-term retention up to 12 years, queryable with search jobs.
- Plans per table: Analytics for what feeds alerts and dashboards, Basic for what is queried during an investigation, Auxiliary for verbose audit logs. Alerts stop working on an Auxiliary table.
Usage | where IsBillable | summarize GB = sum(Quantity) / 1000 by DataTypetells you which table is heavy. The usual culprits: counters every 10 seconds, or Information level on every event log. Fix it in the rule, not the workspace.- A daily cap avoids surprises, but when it is reached everything stops coming in, alerts included. Use it as a safety net with a high threshold and an alert at 80%.
7. The ticket: "srv-file02 has stopped sending data"
The heartbeat alert fires at 06:51. The server answers ping and users are opening their folders.
- Since when? The
Heartbeatquery says 06:41. If every other server at the site is silent too, it's the network or the proxy, not the machine. - Is Arc connected?
azcmagent showResource Name : srv-file02Resource Group Name : rg-arc-dcAgent Status : ConnectedAgent Last Heartbeat : 2026-10-28T07:02:14ZUsing HTTPS Proxy : http://proxy.contoso.local:8080Dependent Service Status Agent Service (himds) : running Extension Service (extensionservice) : running GC Service (gcarcservice) : runningaz monitor data-collection rule association list --resource "/subscriptions/<id>/resourceGroups/rg-arc-dc/providers/Microsoft.HybridCompute/machines/srv-file02" --query "[].name" -o tsv# No results: the server has no rule associated- Is the agent installed and alive? Under the Arc server's Extensions,
AzureMonitorWindowsAgentmust show Succeeded, and theMonAgentCore.exeprocess must be running. The extension logs are inC:\ProgramData\GuestConfig\extension_logs\Microsoft.Azure.Monitor.AzureMonitorWindowsAgent. - Does it have a rule associated? This was the fault: the night before,
dcr-windows-basewas recreated with a different scope and srv-file02 was left out. Without a rule the agent has nothing to send, not even the heartbeat. Re-associate it and the heartbeat appears within minutes. - If the rule is fine, look at the network: the agent needs
global.handler.control.monitor.azure.com,westeurope.handler.control.monitor.azure.comand<workspace-id>.ods.opinsights.azure.com, without TLS inspection. Remember the agent extension may not inherit the Arc proxy: it has its own proxy setting.
Close the ticket with the cause and the prevention: associations are managed by Azure Policy, not by hand in the portal.
Next steps
- The Microsoft Sentinel guide uses this same workspace for security: connectors, KQL rules and incidents.
- The Terraform guide to declare workspaces, collection rules and alerts as code.
- The Backup and DR/BCP guide: the failed backup job alert is the next one that deserves a rule.
Is something missing, or different in your environment? Get in touch and I'll fix it.
Tech Career Lab · newsletter
¿Te ha servido? Cada dos semanas envío una idea práctica para perfiles IT: LinkedIn, proyectos, networking y procesos de selección.Found this useful? Every two weeks I send one practical idea for IT professionals: LinkedIn, projects, networking and hiring processes.
Apúntate y llévate las 33 ideasSign up and get the 33 ideas →