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
* start docs
* save change
* update readme samples
* fix typo
* fix broken link
* fix second link
* example file
* examples links in readme
* panic to todo error
For examples of Logs and Metrics queries, see the [Examples](#examples) section.
72
+
For examples of Logs and Metrics queries, see the [Examples](#examples) section of this readme or in the example_test.go file of our GitHub repo for [azquery](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/monitor/azquery).
73
73
74
74
## Key concepts
75
75
@@ -117,55 +117,47 @@ The timespan can be the following string formats:
117
117
-[Metrics result structure](#metrics-result-structure)
118
118
119
119
### Logs query
120
+
The example below shows a basic logs query using the `QueryWorkspace` method. `QueryWorkspace` takes in a [context][context], a [Log Analytics Workspace][log_analytics_workspace] ID string, a [Body](#logs-query-body-structure) struct, and a [LogsClientQueryWorkspaceOptions](#increase-wait-time-include-statistics-include-render-visualization) struct and returns a [Results](#logs-query-result-structure) struct.
121
+
120
122
```go
121
-
client:= azquery.NewLogsClient(cred, nil)
122
-
timespan:="2022-08-30/2022-08-31"
123
+
workspaceID:="g4d1e129-fb1e-4b0a-b234-250abc987ea65"// example Azure Log Analytics Workspace ID
124
+
query:="AzureActivity | top 10 by TimeGenerated"// Kusto query
125
+
timespan:="2022-08-30/2022-08-31"// ISO8601 Standard timespan
|---Timespan *string // ISO8601 Standard Timespan- refer to timespan section for more info
136
140
|---Workspaces []*string //Optional- additional workspaces to query
137
141
```
138
142
139
143
#### Logs query result structure
140
144
```
141
-
LogsResponse
145
+
Results
142
146
|---Tables []*Table
143
147
|---Columns []*Column
144
148
|---Name *string
145
149
|---Type *LogsColumnType
146
150
|---Name *string
147
151
|---Rows [][]interface{}
148
152
|---Error *ErrorInfo
149
-
|---Code *string
150
-
|---Message *string
151
-
|---AdditionalProperties interface{}
152
-
|---Details []*ErrorDetail
153
-
|---Code *string
154
-
|---Message *string
155
-
|---AdditionalProperties interface{}
156
-
|---Resources []*string
157
-
|---Target *string
158
-
|---Value *string
159
-
|---Innererror *ErrorInfo
160
153
|---Render interface{}
161
154
|---Statistics interface{}
162
155
```
163
156
164
157
### Batch query
158
+
`Batch` is an advanced method allowing users to execute multiple logs queries in a single request. It takes in a [BatchRequest](#batch-query-request-structure) and returns a [BatchResponse](#batch-query-result-structure). `Batch` can return results in any order (usually in order of completion/success). Please use the `ID` attribute to identify the correct response.
165
159
```go
166
-
client:= azquery.NewLogsClient(cred, nil)
167
-
timespan:="2022-08-30/2022-08-31"
168
-
160
+
timespan:="2022-08-30/2022-08-31"// ISO8601 Standard Timespan
0 commit comments