Skip to content

CloudWatchLogsQuery🔗

Shape of a CloudWatch Logs query

Definition🔗

type CloudWatchLogsQuery struct {
    // Whether a query is a Metrics, Logs, or Annotations query
    QueryMode cloudwatch.CloudWatchQueryMode `json:"queryMode"`
    Id string `json:"id"`
    // AWS region to query for the logs
    Region string `json:"region"`
    // The CloudWatch Logs Insights query to execute
    Expression *string `json:"expression,omitempty"`
    // Fields to group the results by, this field is automatically populated whenever the query is updated
    StatsGroups []string `json:"statsGroups,omitempty"`
    // Log groups to query
    LogGroups []cloudwatch.LogGroup `json:"logGroups,omitempty"`
    // 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.
    RefId string `json:"refId"`
    // If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel.
    Hide *bool `json:"hide,omitempty"`
    // Specify the query flavor
    // TODO make this required and give it a default
    QueryType *string `json:"queryType,omitempty"`
    // @deprecated use logGroups
    LogGroupNames []string `json:"logGroupNames,omitempty"`
    // 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
    Datasource *dashboard.DataSourceRef `json:"datasource,omitempty"`
}

Methods🔗

UnmarshalJSONStrict🔗

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode CloudWatchLogsQuery from JSON.

Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (cloudWatchLogsQuery *CloudWatchLogsQuery) UnmarshalJSONStrict(raw []byte) error

Equals🔗

Equals tests the equality of two CloudWatchLogsQuery objects.

func (cloudWatchLogsQuery *CloudWatchLogsQuery) Equals(other CloudWatchLogsQuery) bool

Validate🔗

Validate checks all the validation constraints that may be defined on CloudWatchLogsQuery fields for violations and returns them.

func (cloudWatchLogsQuery *CloudWatchLogsQuery) Validate() error

See also🔗