Skip to content

Commit 39d64d0

Browse files
authored
Edit pass on Monitor Query SDK advanced scenarios example (Azure#20093)
* Edit pass on Monitor Query SDK advanced scenarios example * Edit
1 parent e4076b3 commit 39d64d0

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

sdk/monitor/azure-monitor-query/README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,13 @@ Each set of metric values is a time series with the following characteristics:
101101

102102
- [Single logs query](#single-logs-query)
103103
- [Specify duration](#specify-duration)
104-
- [Query multiple workspaces](#query-multiple-workspaces)
105104
- [Set logs query timeout](#set-logs-query-timeout)
106105
- [Batch logs query](#batch-logs-query)
107106
- [Query metrics](#query-metrics)
108107
- [Handle metrics response](#handle-metrics-response)
109108
- [Example of handling response](#example-of-handling-response)
109+
- [Advanced scenarios](#advanced-scenarios)
110+
- [Query multiple workspaces](#query-multiple-workspaces)
110111

111112
### Single logs query
112113

@@ -301,21 +302,29 @@ for metric in response.metrics:
301302
)
302303
```
303304

304-
### Advacned Scenarios
305+
### Advanced scenarios
305306

306307
#### Query multiple workspaces
307308

308-
One of the more advanced scenarios is to query the same query on multiple workspaces. The `additional_workspaces` parameter can be used to pass a list of workspaces that are included in the query when querying a single query over multiple workspaces. The parameter's list items can be qualified workspace names, workspace IDs, or Azure resource IDs. A primary workspace ID must be provided when querying multiple workspaces, as in the following example:
309+
The same log query can be executed across multiple Log Analytics workspaces. In addition to the KQL query, the following parameters are required:
310+
311+
- `workspace_id` - The first (primary) workspace ID.
312+
- `additional_workspaces` - A list of workspaces, excluding the workspace provided in the `workspace_id` parameter. The parameter's list items may consist of the following identifier formats:
313+
- Qualified workspace names
314+
- Workspace IDs
315+
- Azure resource IDs
316+
317+
For example, the following query executes in three workspaces:
309318

310319
```python
311-
client.query(
312-
<primary_workspace_id>,
320+
client.query(
321+
<workspace_id>,
313322
query,
314-
additional_workspaces=['<workspace 1>', '<workspace 2>']
323+
additional_workspaces=['<workspace 2>', '<workspace 3>']
315324
)
316325
```
317326

318-
The full sample can be found [here](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_log_query_multiple_workspaces.py).
327+
A full sample can be found [here](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_log_query_multiple_workspaces.py).
319328

320329
## Troubleshooting
321330

0 commit comments

Comments
 (0)