You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this article, you'll learn how to enable diagnostic logging in Azure API for FHIR and be able to review some sample queries for these logs. Access to diagnostic logs is essential for any healthcare service where compliance with regulatory requirements (such as HIPAA) is a must. The feature in Azure API for FHIR that enables diagnostic logs is the [**Diagnostic settings**](/azure/azure-monitor/essentials/diagnostic-settings) in the Azure portal.
17
+
In this article, you learn how to enable diagnostic logging in Azure API for FHIR® and be able to review sample queries for these logs. Access to diagnostic logs is essential for any healthcare service where compliance with regulatory requirements (such as HIPAA) is a must. The feature in Azure API for FHIR that enables diagnostic logs is the [**Diagnostic settings**](/azure/azure-monitor/essentials/diagnostic-settings) in the Azure portal.
18
18
19
19
## View and Download FHIR Metrics Data
20
20
21
-
You can view the metrics under Monitoring | Metrics from the portal. The metrics include Number of Requests, Average Latency, Number of Errors, Data Size, RUs Used, Number of requests that exceeded capacity, and Availability (in %). The Total Request Metrics will provide the number of requests reaching the FHIR service. This means for requests such as FHIR bundles, it will be considered as single request for logging.
21
+
You can view the metrics under Monitoring | Metrics from the portal. The metrics include Number of Requests, Average Latency, Number of Errors, Data Size, request units (RUs) Used, Number of requests that exceeded capacity, and Availability (in %). The Total Request Metrics provides the number of requests reaching the FHIR service. This means requests such as FHIR bundles are considered as single request for logging.
22
22
23
-
The screenshot below shows RUs used for a sample environment with few activities in the last seven days. You can download the data in Json format.
23
+
The following screenshot shows RUs used for a sample environment with few activities in the last seven days. You can download the data in Json format.
24
24
25
25
:::image type="content" source="media/diagnostic-logging/fhir-metrics-rus-screen.png" alt-text="Azure API for FHIR Metrics from the portal" lightbox="media/diagnostic-logging/fhir-metrics-rus-screen.png":::
26
26
@@ -36,11 +36,11 @@ The screenshot below shows RUs used for a sample environment with few activities
36
36
37
37
5. Select the method you want to use to access your diagnostic logs:
38
38
39
-
1.**Archive to a storage account** for auditing or manual inspection. The storage account you want to use needs to be already created.
39
+
1.**Archive to a storage account** for auditing or manual inspection. The storage account you want to use needs to already be created.
40
40
2.**Stream to event hub** for ingestion by a third-party service or custom analytic solution. You'll need to create an event hub namespace and event hub policy before you can configure this step.
41
-
3.**Stream to the Log Analytics** workspace in Azure Monitor. You'll need to create your Logs Analytics Workspace before you can select this option.
41
+
3.**Stream to the Log Analytics** workspace in Azure Monitor. You need to create your Logs Analytics Workspace before you can select this option.
42
42
43
-
6. Select **AuditLogs** and/or **AllMetrics**. The metrics include service name, availability, data size, total latency, total requests, total errors and timestamp. You can find more detail on [supported metrics](/azure/azure-monitor/essentials/metrics-supported#microsofthealthcareapisservices).
43
+
6. Select **AuditLogs** and/or **AllMetrics**. The metrics include service name, availability, data size, total latency, total requests, total errors, and timestamp. Find more detail on [supported metrics](/azure/azure-monitor/essentials/metrics-supported#microsofthealthcareapisservices).
@@ -50,62 +50,60 @@ The screenshot below shows RUs used for a sample environment with few activities
50
50
> [!Note]
51
51
> It might take up to 15 minutes for the first Logs to show in Log Analytics. Also, if Azure API for FHIR is moved from one resource group or subscription to another, update the setting once the move is complete.
52
52
53
-
For more information on how to work with diagnostic logs, please refer to the [Azure Resource Log documentation](/azure/azure-monitor/essentials/platform-logs-overview)
53
+
For more information on how to work with diagnostic logs, refer to the [Azure Resource Log documentation](/azure/azure-monitor/essentials/platform-logs-overview).
54
54
55
55
## Audit log details
56
-
At this time, the Azure API for FHIR service returns the following fields in the audit log:
56
+
At this time, the Azure API for FHIR service returns the following fields in the audit log.
57
57
58
58
|Field Name |Type |Notes |
59
59
|---------|---------|---------|
60
60
|CallerIdentity|Dynamic|A generic property bag containing identity information
61
-
|CallerIdentityIssuer|String|Issuer
62
-
|CallerIdentityObjectId|String|Object_Id
63
-
|CallerIPAddress|String|The caller’s IP address
64
-
|CorrelationId|String| Correlation ID
65
-
|FhirResourceType|String|The resource type for which the operation was executed
66
-
|LogCategory|String|The log category (we're currently returning ‘AuditLogs’ LogCategory)
67
-
|Location|String|The location of the server that processed the request (for example, South Central US)
68
-
|OperationDuration|Int|The time it took to complete this request in seconds. Note : This value is always set to 0, due to a known issue
69
-
|OperationName|String| Describes the type of operation (for example, update, search-type)
70
-
|RequestUri|String|The request URI
71
-
|ResultType|String|The available values currently are **Started**, **Succeeded**, or **Failed**
72
-
|StatusCode|Int|The HTTP status code. (for example, 200)
61
+
|CallerIdentityIssuer|String|Issuer |
62
+
|CallerIdentityObjectId|String|Object_Id |
63
+
|CallerIPAddress|String|The caller’s IP address |
64
+
|CorrelationId|String| Correlation ID|
65
+
|FhirResourceType|String|The resource type for which the operation was executed|
|Location|String|The location of the server that processed the request (for example, South Central US)|
68
+
|OperationDuration|Int|The time it took to complete this request in seconds. **Note** : This value is always set to 0, due to a known issue|
69
+
|OperationName|String| Describes the type of operation (for example, update, search-type)|
70
+
|RequestUri|String|The request URI |
71
+
|ResultType|String|The available values currently are **Started**, **Succeeded**, or **Failed**|
72
+
|StatusCode|Int|The HTTP status code. (for example, 200) |
73
73
|TimeGenerated|DateTime|Date and time of the event|
74
-
|Properties|String| Describes the properties of the fhirResourceType
75
-
|SourceSystem|String| Source System (always Azure in this case)
76
-
|TenantId|String|Tenant ID
77
-
|Type|String|Type of log (always MicrosoftHealthcareApisAuditLog in this case)
78
-
|_ResourceId|String|Details about the resource
74
+
|Properties|String| Describes the properties of the fhirResourceType|
75
+
|SourceSystem|String| Source System (always Azure in this case)|
76
+
|TenantId|String|Tenant ID|
77
+
|Type|String|Type of log (always MicrosoftHealthcareApisAuditLog in this case)|
78
+
|_ResourceId|String|Details about the resource|
79
79
80
80
## Sample queries
81
81
82
82
Here are a few basic Application Insights queries you can use to explore your log data.
83
83
84
-
Run this query to see the **100 most recent** logs:
84
+
Run the following query to see the **100 most recent** logs.
85
85
86
86
```Application Insights
87
87
MicrosoftHealthcareApisAuditLogs
88
88
| limit 100
89
89
```
90
90
91
-
Run this query to group operations by **FHIR Resource Type**:
91
+
Run the following query to group operations by **FHIR Resource Type**.
92
92
93
93
```Application Insights
94
94
MicrosoftHealthcareApisAuditLogs
95
95
| summarize count() by FhirResourceType
96
96
```
97
97
98
-
Run this query to get all the **failed results**
98
+
Run the following query to get all the **failed results**.
99
99
100
100
```Application Insights
101
101
MicrosoftHealthcareApisAuditLogs
102
102
| where ResultType == "Failed"
103
103
```
104
104
105
105
## Conclusion
106
-
Having access to diagnostic logs is essential for monitoring a service and providing compliance reports. Azure API for FHIR allows you to do these actions through diagnostic logs.
107
-
108
-
FHIR is the registered trademark of HL7 and is used with the permission of HL7.
106
+
Having access to diagnostic logs is essential for monitoring a service and providing compliance reports. Azure API for FHIR allows you to take these actions through diagnostic logs.
109
107
110
108
## Next steps
111
109
In this article, you learned how to enable Audit Logs for Azure API for FHIR. For information about Azure API for FHIR configuration settings, see
@@ -129,4 +127,4 @@ In this article, you learned how to enable Audit Logs for Azure API for FHIR. Fo
0 commit comments