azure-docs-sdk-java/docs-ref-autogen/com.azure.monitor.query.Log...

309 строки
36 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.monitor.query.LogsQueryClient"
fullName: "com.azure.monitor.query.LogsQueryClient"
name: "LogsQueryClient"
nameWithType: "LogsQueryClient"
summary: "Provides a synchronous service client for querying logs in the Azure Monitor Service."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public final class **LogsQueryClient**"
methods:
- uid: "com.azure.monitor.query.LogsQueryClient.<T>queryResource(java.lang.String,java.lang.String,com.azure.monitor.query.models.QueryTimeInterval,java.lang.Class<T>)"
fullName: "com.azure.monitor.query.LogsQueryClient.queryResource(String resourceId, String query, QueryTimeInterval timeInterval, Class<T> type)"
name: "queryResource(String resourceId, String query, QueryTimeInterval timeInterval, Class<T> type)"
nameWithType: "LogsQueryClient.queryResource(String resourceId, String query, QueryTimeInterval timeInterval, Class<T> type)"
summary: "Returns all the Azure Monitor logs matching the given query for an Azure resource."
parameters:
- description: "The resourceId where the query should be executed."
name: "resourceId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The Kusto query to fetch the logs."
name: "query"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The time period for which the logs should be looked up."
name: "timeInterval"
type: "<xref href=\"com.azure.monitor.query.models.QueryTimeInterval?alt=com.azure.monitor.query.models.QueryTimeInterval&text=QueryTimeInterval\" data-throw-if-not-resolved=\"False\" />"
- description: "The type the result of this query should be mapped to."
name: "type"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html\">Class</a>&lt;<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;"
syntax: "public List<T> <T>queryResource(String resourceId, String query, QueryTimeInterval timeInterval, Class<T> type)"
desc: "Returns all the Azure Monitor logs matching the given query for an Azure resource."
returns:
description: "The logs matching the query as a list of objects of type T."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.monitor.query.LogsQueryClient.<T>queryResource(java.lang.String,java.lang.String,com.azure.monitor.query.models.QueryTimeInterval,java.lang.Class<T>,com.azure.monitor.query.models.LogsQueryOptions)"
fullName: "com.azure.monitor.query.LogsQueryClient.queryResource(String resourceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options)"
name: "queryResource(String resourceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options)"
nameWithType: "LogsQueryClient.queryResource(String resourceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options)"
summary: "Returns all the Azure Monitor logs matching the given query for an Azure resource."
parameters:
- description: "The resourceId where the query should be executed."
name: "resourceId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The Kusto query to fetch the logs."
name: "query"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The time period for which the logs should be looked up."
name: "timeInterval"
type: "<xref href=\"com.azure.monitor.query.models.QueryTimeInterval?alt=com.azure.monitor.query.models.QueryTimeInterval&text=QueryTimeInterval\" data-throw-if-not-resolved=\"False\" />"
- description: "The type the result of this query should be mapped to."
name: "type"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html\">Class</a>&lt;<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The log query options to configure server timeout, set additional workspaces or enable\n statistics and rendering information in response."
name: "options"
type: "<xref href=\"com.azure.monitor.query.models.LogsQueryOptions?alt=com.azure.monitor.query.models.LogsQueryOptions&text=LogsQueryOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public List<T> <T>queryResource(String resourceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options)"
desc: "Returns all the Azure Monitor logs matching the given query for an Azure resource."
returns:
description: "The logs matching the query as a list of objects of type T."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.monitor.query.LogsQueryClient.<T>queryResourceWithResponse(java.lang.String,java.lang.String,com.azure.monitor.query.models.QueryTimeInterval,java.lang.Class<T>,com.azure.monitor.query.models.LogsQueryOptions,com.azure.core.util.Context)"
fullName: "com.azure.monitor.query.LogsQueryClient.queryResourceWithResponse(String resourceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options, Context context)"
name: "queryResourceWithResponse(String resourceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options, Context context)"
nameWithType: "LogsQueryClient.queryResourceWithResponse(String resourceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options, Context context)"
summary: "Returns all the Azure Monitor logs matching the given query for an Azure resource."
parameters:
- description: "The resourceId where the query should be executed."
name: "resourceId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The Kusto query to fetch the logs."
name: "query"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The time period for which the logs should be looked up."
name: "timeInterval"
type: "<xref href=\"com.azure.monitor.query.models.QueryTimeInterval?alt=com.azure.monitor.query.models.QueryTimeInterval&text=QueryTimeInterval\" data-throw-if-not-resolved=\"False\" />"
- description: "The type the result of this query should be mapped to."
name: "type"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html\">Class</a>&lt;<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The log query options to configure server timeout, set additional workspaces or enable\n statistics and rendering information in response."
name: "options"
type: "<xref href=\"com.azure.monitor.query.models.LogsQueryOptions?alt=com.azure.monitor.query.models.LogsQueryOptions&text=LogsQueryOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call. If no\n additional context is required, pass <xref uid=\"com.azure.core.util.Context.NONE\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context#NONE\"></xref> instead."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<List<T>> <T>queryResourceWithResponse(String resourceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options, Context context)"
desc: "Returns all the Azure Monitor logs matching the given query for an Azure resource."
returns:
description: "The logs matching the query including the HTTP response."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;&gt;"
- uid: "com.azure.monitor.query.LogsQueryClient.<T>queryWorkspace(java.lang.String,java.lang.String,com.azure.monitor.query.models.QueryTimeInterval,java.lang.Class<T>)"
fullName: "com.azure.monitor.query.LogsQueryClient.queryWorkspace(String workspaceId, String query, QueryTimeInterval timeInterval, Class<T> type)"
name: "queryWorkspace(String workspaceId, String query, QueryTimeInterval timeInterval, Class<T> type)"
nameWithType: "LogsQueryClient.queryWorkspace(String workspaceId, String query, QueryTimeInterval timeInterval, Class<T> type)"
summary: "Returns all the Azure Monitor logs matching the given query in the specified workspace<wbr>Id."
parameters:
- description: "The workspaceId where the query should be executed."
name: "workspaceId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The Kusto query to fetch the logs."
name: "query"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The time period for which the logs should be looked up."
name: "timeInterval"
type: "<xref href=\"com.azure.monitor.query.models.QueryTimeInterval?alt=com.azure.monitor.query.models.QueryTimeInterval&text=QueryTimeInterval\" data-throw-if-not-resolved=\"False\" />"
- description: "The type the result of this query should be mapped to."
name: "type"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html\">Class</a>&lt;<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;"
syntax: "public List<T> <T>queryWorkspace(String workspaceId, String query, QueryTimeInterval timeInterval, Class<T> type)"
desc: "Returns all the Azure Monitor logs matching the given query in the specified workspaceId."
returns:
description: "The logs matching the query as a list of objects of type T."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.monitor.query.LogsQueryClient.<T>queryWorkspace(java.lang.String,java.lang.String,com.azure.monitor.query.models.QueryTimeInterval,java.lang.Class<T>,com.azure.monitor.query.models.LogsQueryOptions)"
fullName: "com.azure.monitor.query.LogsQueryClient.queryWorkspace(String workspaceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options)"
name: "queryWorkspace(String workspaceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options)"
nameWithType: "LogsQueryClient.queryWorkspace(String workspaceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options)"
summary: "Returns all the Azure Monitor logs matching the given query in the specified workspace<wbr>Id."
parameters:
- description: "The workspaceId where the query should be executed."
name: "workspaceId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The Kusto query to fetch the logs."
name: "query"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The time period for which the logs should be looked up."
name: "timeInterval"
type: "<xref href=\"com.azure.monitor.query.models.QueryTimeInterval?alt=com.azure.monitor.query.models.QueryTimeInterval&text=QueryTimeInterval\" data-throw-if-not-resolved=\"False\" />"
- description: "The type the result of this query should be mapped to."
name: "type"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html\">Class</a>&lt;<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The log query options to configure server timeout, set additional workspaces or enable\n statistics and rendering information in response."
name: "options"
type: "<xref href=\"com.azure.monitor.query.models.LogsQueryOptions?alt=com.azure.monitor.query.models.LogsQueryOptions&text=LogsQueryOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public List<T> <T>queryWorkspace(String workspaceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options)"
desc: "Returns all the Azure Monitor logs matching the given query in the specified workspaceId."
returns:
description: "The logs matching the query as a list of objects of type T."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.monitor.query.LogsQueryClient.<T>queryWorkspaceWithResponse(java.lang.String,java.lang.String,com.azure.monitor.query.models.QueryTimeInterval,java.lang.Class<T>,com.azure.monitor.query.models.LogsQueryOptions,com.azure.core.util.Context)"
fullName: "com.azure.monitor.query.LogsQueryClient.queryWorkspaceWithResponse(String workspaceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options, Context context)"
name: "queryWorkspaceWithResponse(String workspaceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options, Context context)"
nameWithType: "LogsQueryClient.queryWorkspaceWithResponse(String workspaceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options, Context context)"
summary: "Returns all the Azure Monitor logs matching the given query in the specified workspace<wbr>Id."
parameters:
- description: "The workspaceId where the query should be executed."
name: "workspaceId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The Kusto query to fetch the logs."
name: "query"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The time period for which the logs should be looked up."
name: "timeInterval"
type: "<xref href=\"com.azure.monitor.query.models.QueryTimeInterval?alt=com.azure.monitor.query.models.QueryTimeInterval&text=QueryTimeInterval\" data-throw-if-not-resolved=\"False\" />"
- description: "The type the result of this query should be mapped to."
name: "type"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html\">Class</a>&lt;<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;"
- description: "The log query options to configure server timeout, set additional workspaces or enable\n statistics and rendering information in response."
name: "options"
type: "<xref href=\"com.azure.monitor.query.models.LogsQueryOptions?alt=com.azure.monitor.query.models.LogsQueryOptions&text=LogsQueryOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call. If no\n additional context is required, pass <xref uid=\"com.azure.core.util.Context.NONE\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context#NONE\"></xref> instead."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<List<T>> <T>queryWorkspaceWithResponse(String workspaceId, String query, QueryTimeInterval timeInterval, Class<T> type, LogsQueryOptions options, Context context)"
desc: "Returns all the Azure Monitor logs matching the given query in the specified workspaceId."
returns:
description: "The logs matching the query including the HTTP response."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />&gt;&gt;"
- uid: "com.azure.monitor.query.LogsQueryClient.queryBatch(com.azure.monitor.query.models.LogsBatchQuery)"
fullName: "com.azure.monitor.query.LogsQueryClient.queryBatch(LogsBatchQuery logsBatchQuery)"
name: "queryBatch(LogsBatchQuery logsBatchQuery)"
nameWithType: "LogsQueryClient.queryBatch(LogsBatchQuery logsBatchQuery)"
summary: "Returns all the Azure Monitor logs matching the given batch of queries."
parameters:
- description: "<xref uid=\"com.azure.monitor.query.models.LogsBatchQuery\" data-throw-if-not-resolved=\"false\" data-raw-source=\"LogsBatchQuery\"></xref> containing a batch of queries."
name: "logsBatchQuery"
type: "<xref href=\"com.azure.monitor.query.models.LogsBatchQuery?alt=com.azure.monitor.query.models.LogsBatchQuery&text=LogsBatchQuery\" data-throw-if-not-resolved=\"False\" />"
syntax: "public LogsBatchQueryResultCollection queryBatch(LogsBatchQuery logsBatchQuery)"
desc: "Returns all the Azure Monitor logs matching the given batch of queries.\n\n**Execute a batch of logs queries**\n\n```java\nLogsBatchQuery batchQuery = new LogsBatchQuery();\n String queryId1 = batchQuery.addWorkspaceQuery(\"{workspace-id-1}\", \"{kusto-query-1}\", QueryTimeInterval.LAST_DAY);\n String queryId2 = batchQuery.addWorkspaceQuery(\"{workspace-id-2}\", \"{kusto-query-2}\",\n QueryTimeInterval.LAST_7_DAYS, new LogsQueryOptions().setServerTimeout(Duration.ofMinutes(2)));\n\n LogsBatchQueryResultCollection batchQueryResponse = logsQueryClient.queryBatch(batchQuery);\n\n for (LogsBatchQueryResult queryResult : batchQueryResponse.getBatchResults()) {\n System.out.println(\"Logs query result for query id \" + queryResult.getId());\n for (LogsTableRow row : queryResult.getTable().getRows()) {\n System.out.println(row.getRow()\n .stream()\n .map(LogsTableCell::getValueAsString)\n .collect(Collectors.joining(\",\")));\n }\n }\n```"
returns:
description: "A collection of query results corresponding to the input batch of queries.@return"
type: "<xref href=\"com.azure.monitor.query.models.LogsBatchQueryResultCollection?alt=com.azure.monitor.query.models.LogsBatchQueryResultCollection&text=LogsBatchQueryResultCollection\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.monitor.query.LogsQueryClient.queryBatchWithResponse(com.azure.monitor.query.models.LogsBatchQuery,com.azure.core.util.Context)"
fullName: "com.azure.monitor.query.LogsQueryClient.queryBatchWithResponse(LogsBatchQuery logsBatchQuery, Context context)"
name: "queryBatchWithResponse(LogsBatchQuery logsBatchQuery, Context context)"
nameWithType: "LogsQueryClient.queryBatchWithResponse(LogsBatchQuery logsBatchQuery, Context context)"
summary: "Returns all the Azure Monitor logs matching the given batch of queries."
parameters:
- description: "<xref uid=\"com.azure.monitor.query.models.LogsBatchQuery\" data-throw-if-not-resolved=\"false\" data-raw-source=\"LogsBatchQuery\"></xref> containing a batch of queries."
name: "logsBatchQuery"
type: "<xref href=\"com.azure.monitor.query.models.LogsBatchQuery?alt=com.azure.monitor.query.models.LogsBatchQuery&text=LogsBatchQuery\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call. If no\n additional context is required, pass <xref uid=\"com.azure.core.util.Context.NONE\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context#NONE\"></xref> instead."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<LogsBatchQueryResultCollection> queryBatchWithResponse(LogsBatchQuery logsBatchQuery, Context context)"
desc: "Returns all the Azure Monitor logs matching the given batch of queries."
returns:
description: "A collection of query results corresponding to the input batch of queries.@return"
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.monitor.query.models.LogsBatchQueryResultCollection?alt=com.azure.monitor.query.models.LogsBatchQueryResultCollection&text=LogsBatchQueryResultCollection\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.monitor.query.LogsQueryClient.queryResource(java.lang.String,java.lang.String,com.azure.monitor.query.models.QueryTimeInterval)"
fullName: "com.azure.monitor.query.LogsQueryClient.queryResource(String resourceId, String query, QueryTimeInterval timeInterval)"
name: "queryResource(String resourceId, String query, QueryTimeInterval timeInterval)"
nameWithType: "LogsQueryClient.queryResource(String resourceId, String query, QueryTimeInterval timeInterval)"
summary: "Returns all the Azure Monitor logs matching the given query for an Azure resource."
parameters:
- description: "The resourceId where the query should be executed."
name: "resourceId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The Kusto query to fetch the logs."
name: "query"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The time period for which the logs should be looked up."
name: "timeInterval"
type: "<xref href=\"com.azure.monitor.query.models.QueryTimeInterval?alt=com.azure.monitor.query.models.QueryTimeInterval&text=QueryTimeInterval\" data-throw-if-not-resolved=\"False\" />"
syntax: "public LogsQueryResult queryResource(String resourceId, String query, QueryTimeInterval timeInterval)"
desc: "Returns all the Azure Monitor logs matching the given query for an Azure resource.\n\n**Query logs from the last 24 hours**\n\n```java\nLogsQueryResult queryResult = logsQueryClient.queryResource(\"{resource-id}\", \"{kusto-query}\",\n QueryTimeInterval.LAST_DAY);\n for (LogsTableRow row : queryResult.getTable().getRows()) {\n System.out.println(row.getRow()\n .stream()\n .map(LogsTableCell::getValueAsString)\n .collect(Collectors.joining(\",\")));\n }\n```"
returns:
description: "The logs matching the query."
type: "<xref href=\"com.azure.monitor.query.models.LogsQueryResult?alt=com.azure.monitor.query.models.LogsQueryResult&text=LogsQueryResult\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.monitor.query.LogsQueryClient.queryResourceWithResponse(java.lang.String,java.lang.String,com.azure.monitor.query.models.QueryTimeInterval,com.azure.monitor.query.models.LogsQueryOptions,com.azure.core.util.Context)"
fullName: "com.azure.monitor.query.LogsQueryClient.queryResourceWithResponse(String resourceId, String query, QueryTimeInterval timeInterval, LogsQueryOptions options, Context context)"
name: "queryResourceWithResponse(String resourceId, String query, QueryTimeInterval timeInterval, LogsQueryOptions options, Context context)"
nameWithType: "LogsQueryClient.queryResourceWithResponse(String resourceId, String query, QueryTimeInterval timeInterval, LogsQueryOptions options, Context context)"
summary: "Returns all the Azure Monitor logs matching the given query for an Azure resource."
parameters:
- description: "The resourceId where the query should be executed."
name: "resourceId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The Kusto query to fetch the logs."
name: "query"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The time period for which the logs should be looked up."
name: "timeInterval"
type: "<xref href=\"com.azure.monitor.query.models.QueryTimeInterval?alt=com.azure.monitor.query.models.QueryTimeInterval&text=QueryTimeInterval\" data-throw-if-not-resolved=\"False\" />"
- description: "The log query options to configure server timeout, set additional workspaces or enable\n statistics and rendering information in response."
name: "options"
type: "<xref href=\"com.azure.monitor.query.models.LogsQueryOptions?alt=com.azure.monitor.query.models.LogsQueryOptions&text=LogsQueryOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call. If no\n additional context is required, pass <xref uid=\"com.azure.core.util.Context.NONE\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context#NONE\"></xref> instead."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<LogsQueryResult> queryResourceWithResponse(String resourceId, String query, QueryTimeInterval timeInterval, LogsQueryOptions options, Context context)"
desc: "Returns all the Azure Monitor logs matching the given query for an Azure resource.\n\n**Query logs from the last 7 days and set the service timeout to 2 minutes**\n\n```java\nResponse<LogsQueryResult> queryResult = logsQueryClient.queryResourceWithResponse(\"{resource-id}\",\n \"{kusto-query}\",\n QueryTimeInterval.LAST_7_DAYS,\n new LogsQueryOptions().setServerTimeout(Duration.ofMinutes(2)),\n Context.NONE);\n\n for (LogsTableRow row : queryResult.getValue().getTable().getRows()) {\n System.out.println(row.getRow()\n .stream()\n .map(LogsTableCell::getValueAsString)\n .collect(Collectors.joining(\",\")));\n }\n```"
returns:
description: "The logs matching the query including the HTTP response."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.monitor.query.models.LogsQueryResult?alt=com.azure.monitor.query.models.LogsQueryResult&text=LogsQueryResult\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.monitor.query.LogsQueryClient.queryWorkspace(java.lang.String,java.lang.String,com.azure.monitor.query.models.QueryTimeInterval)"
fullName: "com.azure.monitor.query.LogsQueryClient.queryWorkspace(String workspaceId, String query, QueryTimeInterval timeInterval)"
name: "queryWorkspace(String workspaceId, String query, QueryTimeInterval timeInterval)"
nameWithType: "LogsQueryClient.queryWorkspace(String workspaceId, String query, QueryTimeInterval timeInterval)"
summary: "Returns all the Azure Monitor logs matching the given query in the specified workspace<wbr>Id."
parameters:
- description: "The workspaceId where the query should be executed."
name: "workspaceId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The Kusto query to fetch the logs."
name: "query"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The time period for which the logs should be looked up."
name: "timeInterval"
type: "<xref href=\"com.azure.monitor.query.models.QueryTimeInterval?alt=com.azure.monitor.query.models.QueryTimeInterval&text=QueryTimeInterval\" data-throw-if-not-resolved=\"False\" />"
syntax: "public LogsQueryResult queryWorkspace(String workspaceId, String query, QueryTimeInterval timeInterval)"
desc: "Returns all the Azure Monitor logs matching the given query in the specified workspaceId.\n\n**Query logs from the last 24 hours**\n\n```java\nLogsQueryResult queryResult = logsQueryClient.queryWorkspace(\"{workspace-id}\", \"{kusto-query}\",\n QueryTimeInterval.LAST_DAY);\n for (LogsTableRow row : queryResult.getTable().getRows()) {\n System.out.println(row.getRow()\n .stream()\n .map(LogsTableCell::getValueAsString)\n .collect(Collectors.joining(\",\")));\n }\n```"
returns:
description: "The logs matching the query."
type: "<xref href=\"com.azure.monitor.query.models.LogsQueryResult?alt=com.azure.monitor.query.models.LogsQueryResult&text=LogsQueryResult\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.monitor.query.LogsQueryClient.queryWorkspaceWithResponse(java.lang.String,java.lang.String,com.azure.monitor.query.models.QueryTimeInterval,com.azure.monitor.query.models.LogsQueryOptions,com.azure.core.util.Context)"
fullName: "com.azure.monitor.query.LogsQueryClient.queryWorkspaceWithResponse(String workspaceId, String query, QueryTimeInterval timeInterval, LogsQueryOptions options, Context context)"
name: "queryWorkspaceWithResponse(String workspaceId, String query, QueryTimeInterval timeInterval, LogsQueryOptions options, Context context)"
nameWithType: "LogsQueryClient.queryWorkspaceWithResponse(String workspaceId, String query, QueryTimeInterval timeInterval, LogsQueryOptions options, Context context)"
summary: "Returns all the Azure Monitor logs matching the given query in the specified workspace<wbr>Id."
parameters:
- description: "The workspaceId where the query should be executed."
name: "workspaceId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The Kusto query to fetch the logs."
name: "query"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The time period for which the logs should be looked up."
name: "timeInterval"
type: "<xref href=\"com.azure.monitor.query.models.QueryTimeInterval?alt=com.azure.monitor.query.models.QueryTimeInterval&text=QueryTimeInterval\" data-throw-if-not-resolved=\"False\" />"
- description: "The log query options to configure server timeout, set additional workspaces or enable\n statistics and rendering information in response."
name: "options"
type: "<xref href=\"com.azure.monitor.query.models.LogsQueryOptions?alt=com.azure.monitor.query.models.LogsQueryOptions&text=LogsQueryOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the Http pipeline during the service call. If no\n additional context is required, pass <xref uid=\"com.azure.core.util.Context.NONE\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context#NONE\"></xref> instead."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<LogsQueryResult> queryWorkspaceWithResponse(String workspaceId, String query, QueryTimeInterval timeInterval, LogsQueryOptions options, Context context)"
desc: "Returns all the Azure Monitor logs matching the given query in the specified workspaceId.\n\n**Query logs from the last 7 days and set the service timeout to 2 minutes**\n\n```java\nResponse<LogsQueryResult> queryResult = logsQueryClient.queryWorkspaceWithResponse(\"{workspace-id}\",\n \"{kusto-query}\",\n QueryTimeInterval.LAST_7_DAYS,\n new LogsQueryOptions().setServerTimeout(Duration.ofMinutes(2)),\n Context.NONE);\n\n for (LogsTableRow row : queryResult.getValue().getTable().getRows()) {\n System.out.println(row.getRow()\n .stream()\n .map(LogsTableCell::getValueAsString)\n .collect(Collectors.joining(\",\")));\n }\n```"
returns:
description: "The logs matching the query including the HTTP response."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.monitor.query.models.LogsQueryResult?alt=com.azure.monitor.query.models.LogsQueryResult&text=LogsQueryResult\" data-throw-if-not-resolved=\"False\" />&gt;"
type: "class"
desc: "Provides a synchronous service client for querying logs in the Azure Monitor Service.\n\nThe LogsQueryClient is a synchronous client that provides methods to execute Kusto queries against Azure Monitor logs. It provides methods to query logs in a specific workspace, execute a batch of queries, and query logs for a specific Azure resource.\n\n## Getting Started ##\n\nAuthenticating and building instances of this client are handled by <xref uid=\"com.azure.monitor.query.LogsQueryClientBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"LogsQueryClientBuilder\"></xref>. his sample shows how to authenticate and build a LogsQueryClient instance using LogQueryClientBuilder.\n\n```java\nLogsQueryClient logsQueryClient = new LogsQueryClientBuilder()\n .credential(tokenCredential)\n .buildClient();\n```\n\nFor more information on building and authenticating, see the <xref uid=\"com.azure.monitor.query.LogsQueryClientBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"LogsQueryClientBuilder\"></xref> documentation.\n\n### Client Usage ###\n\nFor more information on how to use this client, see the following method documentation:\n\n * <xref uid=\"com.azure.monitor.query.LogsQueryClient.queryWorkspace(java.lang.String,java.lang.String,com.azure.monitor.query.models.QueryTimeInterval)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"queryWorkspace(String, String, QueryTimeInterval)\"></xref> \\- Query logs from a workspace.\n * <xref uid=\"com.azure.monitor.query.LogsQueryClient.queryWorkspaceWithResponse(java.lang.String,java.lang.String,com.azure.monitor.query.models.QueryTimeInterval,com.azure.monitor.query.models.LogsQueryOptions,com.azure.core.util.Context)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"queryWorkspaceWithResponse(String, String, QueryTimeInterval, LogsQueryOptions, Context)\"></xref> \\- Query logs from a workspace using query options and context with service response returned.\n * <xref uid=\"com.azure.monitor.query.LogsQueryClient.queryBatch(com.azure.monitor.query.models.LogsBatchQuery)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"queryBatch(LogsBatchQuery)\"></xref> \\- Execute a batch of logs queries.\n * <xref uid=\"com.azure.monitor.query.LogsQueryClient.queryBatchWithResponse(com.azure.monitor.query.models.LogsBatchQuery,com.azure.core.util.Context)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"queryBatchWithResponse(LogsBatchQuery, Context)\"></xref> \\- Execute a batch of logs queries with context and service response returned.\n * <xref uid=\"com.azure.monitor.query.LogsQueryClient.queryResource(java.lang.String,java.lang.String,com.azure.monitor.query.models.QueryTimeInterval)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"queryResource(String, String, QueryTimeInterval)\"></xref> \\- Query logs for an Azure resource.\n * <xref uid=\"com.azure.monitor.query.LogsQueryClient.queryResourceWithResponse(java.lang.String,java.lang.String,com.azure.monitor.query.models.QueryTimeInterval,com.azure.monitor.query.models.LogsQueryOptions,com.azure.core.util.Context)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"queryResourceWithResponse(String, String, QueryTimeInterval, LogsQueryOptions, Context)\"></xref> \\- Query logs for an Azure resource with query options and context with service response returned."
metadata: {}
package: "com.azure.monitor.query"
artifact: com.azure:azure-monitor-query:1.5.3