astronomer.providers.amazon.aws.hooks.aws_logs

Module Contents

Classes

AwsLogsHookAsync

Interact with AWS CloudWatch Logs using aiobotocore python library

class astronomer.providers.amazon.aws.hooks.aws_logs.AwsLogsHookAsync(*args, **kwargs)[source]

Bases: astronomer.providers.amazon.aws.hooks.base_aws_async.AwsBaseHookAsync

Interact with AWS CloudWatch Logs using aiobotocore python library

Additional arguments (such as aws_conn_id) may be specified and are passed down to the underlying AwsBaseHook.

async describe_log_streams_async(log_group, stream_prefix, order_by, count)[source]

Async function to get the list of log streams for the specified log group. You can list all the log streams or filter the results by prefix. You can also control how the results are ordered.

Parameters:
  • log_group (str) – The name of the log group.

  • stream_prefix (str) – The prefix to match.

  • order_by (str) – If the value is LogStreamName , the results are ordered by log stream name. If the value is LastEventTime , the results are ordered by the event time. The default value is LogStreamName.

  • count (int) – The maximum number of items returned

async get_log_events_async(log_group, log_stream_name, start_time=0, skip=0, start_from_head=True)[source]

A generator for log items in a single stream. This will yield all the items that are available at the current moment.

Parameters:
  • log_group (str) – The name of the log group.

  • log_stream_name (str) – The name of the specific stream.

  • start_time (int) – The time stamp value to start reading the logs from (default: 0).

  • skip (int) – The number of log entries to skip at the start (default: 0). This is for when there are multiple entries at the same timestamp.

  • start_from_head (bool) – whether to start from the beginning (True) of the log or at the end of the log (False).