LogsBatchQuery.AddWorkspaceQuery Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds the specified query to the batch. Results can be retrieved after the query is submitted via the QueryBatchAsync(LogsBatchQuery, CancellationToken) call.
string countQueryId = batch.AddWorkspaceQuery(
workspaceId,
"AzureActivity | count",
new QueryTimeRange(TimeSpan.FromDays(1)));
string topQueryId = batch.AddWorkspaceQuery(
workspaceId,
"AzureActivity | summarize Count = count() by ResourceGroup | top 10 by Count",
new QueryTimeRange(TimeSpan.FromDays(1)));
Response<LogsBatchQueryResultCollection> response = await client.QueryBatchAsync(batch);
var count = response.Value.GetResult<int>(countQueryId).Single();
var topEntries = response.Value.GetResult<MyLogEntryModel>(topQueryId);
public virtual string AddWorkspaceQuery(string workspaceId, string query, Azure.Monitor.Query.QueryTimeRange timeRange, Azure.Monitor.Query.LogsQueryOptions options = default);
abstract member AddWorkspaceQuery : string * string * Azure.Monitor.Query.QueryTimeRange * Azure.Monitor.Query.LogsQueryOptions -> string
override this.AddWorkspaceQuery : string * string * Azure.Monitor.Query.QueryTimeRange * Azure.Monitor.Query.LogsQueryOptions -> string
Public Overridable Function AddWorkspaceQuery (workspaceId As String, query As String, timeRange As QueryTimeRange, Optional options As LogsQueryOptions = Nothing) As String
Parameters
- workspaceId
- String
The workspace to include in the query.
- query
- String
The query text to execute.
- timeRange
- QueryTimeRange
The timespan over which to query data.
- options
- LogsQueryOptions
The LogsQueryOptions to configure the query.
Returns
The query identifier that has to be passed into GetResult(String) to get the result.
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
Azure SDK for .NET