Skip to content

LogsQueryBuilder🔗

Shape of a CloudWatch Logs query

Constructor🔗

new LogsQueryBuilder()

Methods🔗

build🔗

Builds the object.

public LogsQuery build()

datasource🔗

For mixed data sources the selected datasource is on the query level.

For non mixed scenarios this is undefined.

TODO find a better way to do this ^ that's friendly to schema

TODO this shouldn't be unknown but DataSourceRef | null

public LogsQueryBuilder datasource(DataSourceRef datasource)

expression🔗

The CloudWatch Logs Insights query to execute

public LogsQueryBuilder expression(String expression)

hide🔗

If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel.

public LogsQueryBuilder hide(Boolean hide)

id🔗

public LogsQueryBuilder id(String id)

logGroupNames🔗

@deprecated use logGroups

public LogsQueryBuilder logGroupNames(List<String> logGroupNames)

logGroups🔗

Log groups to query

public LogsQueryBuilder logGroups(List<com.grafana.foundation.cog.Builder<LogGroup>> logGroups)

queryLanguage🔗

Language used for querying logs, can be CWLI, SQL, or PPL. If empty, the default language is CWLI.

public LogsQueryBuilder queryLanguage(LogsQueryLanguage queryLanguage)

queryMode🔗

Whether a query is a Metrics, Logs, or Annotations query

public LogsQueryBuilder queryMode(QueryMode queryMode)

queryType🔗

Specify the query flavor

TODO make this required and give it a default

public LogsQueryBuilder queryType(String queryType)

refId🔗

A unique identifier for the query within the list of targets.

In server side expressions, the refId is used as a variable name to identify results.

By default, the UI will assign A->Z; however setting meaningful names may be useful.

public LogsQueryBuilder refId(String refId)

region🔗

AWS region to query for the logs

public LogsQueryBuilder region(String region)

statsGroups🔗

Fields to group the results by, this field is automatically populated whenever the query is updated

public LogsQueryBuilder statsGroups(List<String> statsGroups)

See also🔗