Skip to content

Instantly share code, notes, and snippets.

@nicornk
nicornk / tail.py
Last active July 7, 2022 07:43 — forked from alanyee/tail.py
Boto3 Tail AWS Cloudwatch Logs
"""Using boto3, instead of awscli, to tail logs.
Based on https://github.com/aws/aws-cli/blob/v2/awscli/customizations/logs/tail.py
and
https://gist.github.com/alanyee/601f995bfd6acfd4c3c16ee7e9115ab5
"""
from collections import defaultdict
import time
import re
from botocore.utils import parse_timestamp, datetime2timestamp