LogsQueryOptions Class

  • java.lang.Object
    • com.azure.monitor.query.models.LogsQueryOptions

public final class LogsQueryOptions

The options type to configure the logs query

Constructor Summary

Constructor Description
LogsQueryOptions()

Method Summary

Modifier and Type Method and Description
List<String> getAdditionalWorkspaces()

Returns the list of additional workspaces on which this query is executed.

Duration getServerTimeout()

Returns the server timeout for this query.

boolean isAllowPartialErrors()

If a query has partial errors, the result is returned instead of throwing an exception if this is set to true.

boolean isIncludeStatistics()

Returns the flag that indicates if the query should include statistics.

boolean isIncludeVisualization()

Returns the flag that indicates if the query should return visualization details.

LogsQueryOptions setAdditionalWorkspaces(String[] additionalWorkspaces)

Sets the list of additional workspaces on which this query is executed.

LogsQueryOptions setAdditionalWorkspaces(List<String> additionalWorkspaces)

Sets the list of additional workspaces on which this query is executed.

LogsQueryOptions setAllowPartialErrors(boolean allowPartialErrors)

If set to true, exception is not thrown if query returns partial errors.

LogsQueryOptions setIncludeStatistics(boolean includeStatistics)

Sets the flag that indicates if the query should include statistics.

LogsQueryOptions setIncludeVisualization(boolean includeVisualization)

Sets the flag that indicates if the query should return visualization details.

LogsQueryOptions setServerTimeout(Duration serverTimeout)

Sets the server timeout for this query.

Methods inherited from java.lang.Object

Constructor Details

LogsQueryOptions

public LogsQueryOptions()

Method Details

getAdditionalWorkspaces

public List getAdditionalWorkspaces()

Returns the list of additional workspaces on which this query is executed. The list can contain any of the following workspace identifiers:

  • Workspace Name - human-readable string `` of the OMS workspace
  • Qualified Name - string with format //
  • Workspace ID - GUID string
  • Azure Resource ID - string with format /subscriptions//resourceGroups//providers/microsoft .operationalinsights/workspaces/

Returns:

the list of additional workspaces on which this query is executed.

getServerTimeout

public Duration getServerTimeout()

Returns the server timeout for this query.

Returns:

The server timeout duration.

isAllowPartialErrors

public boolean isAllowPartialErrors()

If a query has partial errors, the result is returned instead of throwing an exception if this is set to true. The partial error information is available as part of the query result.

Returns:

Returns true if partial errors should not throw exception.

isIncludeStatistics

public boolean isIncludeStatistics()

Returns the flag that indicates if the query should include statistics.

Returns:

the flag that indicates if the query should include statistics.

isIncludeVisualization

public boolean isIncludeVisualization()

Returns the flag that indicates if the query should return visualization details.

Returns:

The flag that indicates if the query should return visualization details.

setAdditionalWorkspaces

public LogsQueryOptions setAdditionalWorkspaces(String[] additionalWorkspaces)

Sets the list of additional workspaces on which this query is executed. The list can contain any of the following workspace identifiers:

  • Workspace Name - human-readable string `` of the OMS workspace
  • Qualified Name - string with format //
  • Workspace ID - GUID string
  • Azure Resource ID - string with format /subscriptions//resourceGroups//providers/microsoft .operationalinsights/workspaces/

Parameters:

additionalWorkspaces - additional workspaces on which this query is executed.

Returns:

The updated options instance.

setAdditionalWorkspaces

public LogsQueryOptions setAdditionalWorkspaces(List additionalWorkspaces)

Sets the list of additional workspaces on which this query is executed. The list can contain any of the following workspace identifiers:

  • Workspace Name - human-readable string `` of the OMS workspace
  • Qualified Name - string with format //
  • Workspace ID - GUID string
  • Azure Resource ID - string with format /subscriptions//resourceGroups//providers/microsoft .operationalinsights/workspaces/

Parameters:

additionalWorkspaces - the list of additional workspaces on which this query is executed.

Returns:

The updated options instance.

setAllowPartialErrors

public LogsQueryOptions setAllowPartialErrors(boolean allowPartialErrors)

If set to true, exception is not thrown if query returns partial errors. The partial error information is available as part of the query result.

Parameters:

allowPartialErrors - set this to true to not throw exception if a query returns partial errors.

Returns:

The updated options instance.

setIncludeStatistics

public LogsQueryOptions setIncludeStatistics(boolean includeStatistics)

Sets the flag that indicates if the query should include statistics.

Parameters:

includeStatistics - the flag that indicates if the query should include statistics.

Returns:

The updated options instance.

setIncludeVisualization

public LogsQueryOptions setIncludeVisualization(boolean includeVisualization)

Sets the flag that indicates if the query should return visualization details.

Parameters:

includeVisualization - The flag that indicates if the query should return visualization details.

Returns:

The updated options instance.

setServerTimeout

public LogsQueryOptions setServerTimeout(Duration serverTimeout)

Sets the server timeout for this query.

Parameters:

serverTimeout - The server timeout duration.

Returns:

The updated options instance.

Applies to