import boto3

AK = "AKIAR6OUM5M"
SK = "B52Y/Rv0h2nOY"

logs = boto3.client(
    "logs",
    region_name='cn-northwest-1',
    aws_access_key_id=AK,
    aws_secret_access_key=SK,
    aws_session_token=None
)

response = logs.filter_log_events(
    logGroupName="/aws/lambda/xcloud-code2",
    filterPattern="secret_code")

print(response)
print(response["events"][-1]["message"])
msg = response["events"][-1]["message"]



# data ={
#     'events': [
#         {
#             'logStreamName': 'string',
#             'timestamp': 123,
#             'message': 'string',
#             'ingestionTime': 123,
#             'eventId': 'string'
#         },
#     ],
#     'searchedLogStreams': [
#         {
#             'logStreamName': 'string',
#             'searchedCompletely': True|False
#         },
#     ],
#     'nextToken': 'string'
# }

# print(data['events'][0]["message"])

# "secret_code":"Sunday"


