Habilitación del registro de diagnóstico en Azure API for FHIREnable Diagnostic Logging in Azure API for FHIR
En este artículo aprenderá a habilitar el registro de diagnóstico en Azure API for FHIR y podrá revisar algunas consultas de ejemplo de estos registros.In this article, you will learn how to enable diagnostic logging in Azure API for FHIR and be able to review some sample queries for these logs. El acceso a los registros de diagnóstico es esencial para cualquier servicio del sector sanitario en el que el cumplimiento de los requisitos normativos (como HIPAA) es imprescindible.Access to diagnostic logs is essential for any healthcare service where compliance with regulatory requirements (such as HIPAA) is a must. La característica de Azure API for FHIR que permite los registros de diagnóstico es Configuración de diagnóstico de Azure Portal.The feature in Azure API for FHIR that enables diagnostic logs is the Diagnostic settings in the Azure portal.
Visualización y descarga de datos de métricas de FHIRView and Download FHIR Metrics Data
Puede ver las métricas en Supervisión | Métricas del portal.You can view the metrics under Monitoring | Metrics from the portal. Entre las métricas se incluyen el número de solicitudes, la latencia media, el número de errores, el tamaño de los datos, la RU usada, el número de solicitudes que superaron la capacidad y la disponibilidad (en %).The metrics include Number of Requests, Average Latency, Number of Errors, Data Size, RUs Used, Number of requests that exceeded capacity, and Availability (in %). En la captura de pantalla siguiente se muestra el RU usado para un entorno de ejemplo con muy pocas actividades en los últimos 7 días.The screenshot below shows RUs used for a sample environment with very few activities in the last 7 days. Puede descargar los datos en formato JSON.You can download the data in Json format.
Habilitación de los registros de auditoríaEnable audit logs
Para habilitar el registro de diagnóstico en Azure API for FHIR, seleccione el servicio Azure API for FHIR en Azure Portal.To enable diagnostic logging in Azure API for FHIR, select your Azure API for FHIR service in the Azure portal
Vaya a Configuración de diagnóstico.Navigate to Diagnostic settings
Seleccione + Agregar configuración de diagnóstico.Select + Add diagnostic setting
Escriba un nombre para la configuración.Enter a name for the setting
Seleccione el método que desea usar para acceder a los registros de diagnóstico:Select the method you want to use to access your diagnostic logs:
- Archivar en una cuenta de almacenamiento para auditoría o inspección manual.Archive to a storage account for auditing or manual inspection. Es necesario que la cuenta de almacenamiento que desea usar ya esté creada.The storage account you want to use needs to be already created.
- Transmitir a un centro de eventos para la ingesta en un servicio de terceros o una solución de análisis personalizado.Stream to event hub for ingestion by a third-party service or custom analytic solution. Tendrá que crear un espacio de nombres de centro de eventos y una directiva de centro de eventos para poder configurar este paso.You will need to create an event hub namespace and event hub policy before you can configure this step.
- Transmitir al área de trabajo de Log Analytics en Azure Monitor.Stream to the Log Analytics workspace in Azure Monitor. Tendrá que crear el área de trabajo de Log Analytics para poder seleccionar esta opción.You will need to create your Logs Analytics Workspace before you can select this option.
Seleccione AuditLogs y/o AllMetrics.Select AuditLogs and/or AllMetrics. Las métricas incluyen el nombre del servicio, la disponibilidad, el tamaño de los datos, la latencia total, las solicitudes totales, los errores totales y la marca de tiempo.The metrics include service name, availability, data size, total latency, total requests, total errors and timestamp. Puede encontrar más información en las métricas admitidas.You can find more detail on supported metrics.
Seleccione Guardar.Select Save
Nota
Los primeros registros pueden tardar hasta quince minutos en mostrarse en Log Analytics.It might take up to 15 minutes for the first Logs to show in Log Analytics. Además, si Azure API for FHIR se mueve de un grupo de recursos a otro o de una suscripción a otra, deberá actualizar la configuración una vez completado el traslado.Also, if Azure API for FHIR is moved from one resource group or subscription to another, update the setting once the move is complete.
Para más información sobre cómo trabajar con los registros de diagnóstico, consulte la documentación del registro de recursos de Azure.For more information on how to work with diagnostic logs, please refer to the Azure Resource Log documentation
Detalles del registro de auditoríaAudit log details
En este momento, el servicio Azure API for FHIR devuelve los campos siguientes en el registro de auditoría:At this time, the Azure API for FHIR service returns the following fields in the audit log:
Nombre del campoField Name | TipoType | NotasNotes |
---|---|---|
CallerIdentityCallerIdentity | DinámicaDynamic | Bolsa de propiedades genérica que contiene información de identidadA generic property bag containing identity information |
CallerIdentityIssuerCallerIdentityIssuer | StringString | EmisorIssuer |
CallerIdentityObjectIdCallerIdentityObjectId | StringString | Object_IdObject_Id |
CallerIPAddressCallerIPAddress | StringString | Dirección IP del autor de la llamadaThe caller’s IP address |
CorrelationIdCorrelationId | StringString | Id. de correlaciónCorrelation ID |
FhirResourceTypeFhirResourceType | StringString | El tipo de recurso para el que se ejecutó la operaciónThe resource type for which the operation was executed |
LogCategoryLogCategory | StringString | Categoría de registro (actualmente se devuelve "AuditLogs" LogCategory)The log category (we are currently returning ‘AuditLogs’ LogCategory) |
LocationLocation | StringString | La ubicación del servidor que procesó la solicitud (por ejemplo, Centro-sur de EE. UU.)The location of the server that processed the request (e.g., South Central US) |
OperationDurationOperationDuration | IntInt | El tiempo que se tardó en completar esta solicitud en segundosThe time it took to complete this request in seconds |
OperationNameOperationName | StringString | Describe el tipo de operación (por ejemplo, actualizar o tipo de búsqueda)Describes the type of operation (e.g. update, search-type) |
RequestUriRequestUri | StringString | URI de solicitudThe request URI |
ResultTypeResultType | StringString | Los valores disponibles actualmente son Started, Succeeded o FailedThe available values currently are Started, Succeeded, or Failed |
StatusCodeStatusCode | IntInt | El código de estado HTTP.The HTTP status code. (por ejemplo, 200)(e.g., 200) |
TimeGeneratedTimeGenerated | DateTimeDateTime | Fecha y hora del eventoDate and time of the event |
PropiedadesProperties | StringString | Describe las propiedades de fhirResourceTypeDescribes the properties of the fhirResourceType |
SourceSystemSourceSystem | StringString | Sistema de origen (siempre Azure en este caso)Source System (always Azure in this case) |
TenantIdTenantId | StringString | Id. de inquilinoTenant ID |
TipoType | StringString | Tipo de registro (siempre MicrosoftHealthcareApisAuditLog en este caso)Type of log (always MicrosoftHealthcareApisAuditLog in this case) |
_ResourceId_ResourceId | StringString | Detalles sobre el recursoDetails about the resource |
Consultas de ejemploSample queries
Estas son algunas consultas básicas de Application Insights que puede utilizar para explorar los datos de registro.Here are a few basic Application Insights queries you can use to explore your log data.
Ejecute esta consulta para ver los cien registros más recientes:Run this query to see the 100 most recent logs:
MicrosoftHealthcareApisAuditLogs
| limit 100
Ejecute esta consulta para agrupar las operaciones por tipo de recurso de FHIR:Run this query to group operations by FHIR Resource Type:
MicrosoftHealthcareApisAuditLogs
| summarize count() by FhirResourceType
Ejecute esta consulta para obtener todos los resultados con errores:Run this query to get all the failed results
MicrosoftHealthcareApisAuditLogs
| where ResultType == "Failed"
ConclusiónConclusion
Tener acceso a los registros de diagnóstico es esencial para supervisar un servicio y proporcionar informes de cumplimiento.Having access to diagnostic logs is essential for monitoring a service and providing compliance reports. Azure API for FHIR le permite realizar estas acciones mediante registros de diagnóstico.Azure API for FHIR allows you to do these actions through diagnostic logs.
FHIR es la marca registrada de HL7 y se usa con su permiso.FHIR is the registered trademark of HL7 and is used with the permission of HL7.
Pasos siguientesNext steps
En este artículo, aprendió a habilitar los registros de auditoría para Azure API for FHIR.In this article, you learned how to enable Audit Logs for Azure API for FHIR. A continuación, obtenga información sobre otras valores adicionales que puede configurar en Azure API for FHIR.Next, learn about other additional settings you can configure in the Azure API for FHIR