awswrangler.cloudwatch.wait_query

awswrangler.cloudwatch.wait_query(query_id: str, boto3_session: Session | None = None, cloudwatch_query_wait_polling_delay: float = 1.0) dict[str, Any]

Wait query ends.

https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html

Note

This function has arguments which can be configured globally through wr.config or environment variables:

  • cloudwatch_query_wait_polling_delay

Check out the Global Configurations Tutorial for details.

Parameters:
  • query_id (str) – Query ID.

  • boto3_session (boto3.Session(), optional) – Boto3 Session. The default boto3 session will be used if boto3_session receive None.

  • cloudwatch_query_wait_polling_delay (float, default: 0.2 seconds) – Interval in seconds for how often the function will check if the CloudWatch query has completed.

Returns:

Query result payload.

Return type:

Dict[str, Any]

Examples

>>> import awswrangler as wr
>>> query_id = wr.cloudwatch.start_query(
...     log_group_names=["loggroup"],
...     query="fields @timestamp, @message | sort @timestamp desc | limit 5",
... )
... response = wr.cloudwatch.wait_query(query_id=query_id)