LambdaのTestボタンから選べるCloudWatchLogsのサンプル
1 2 3 4 5 |
{ "awslogs": { "data": "H4sIAAAAAAAAAHWPwQqCQBCGX0Xm7EFtK+smZBEUgXoLCdMhFtKV3akI8d0bLYmibvPPN3wz00CJxmQnTO41whwWQRIctmEcB6sQbFC3CjW3XW8kxpOpP+OC22d1Wml1qZkQGtoMsScxaczKN3plG8zlaHIta5KqWsozoTYw3/djzwhpLwivWFGHGpAFe7DL68JlBUk+l7KSN7tCOEJ4M3/qOI49vMHj+zCKdlFqLaU2ZHV2a4Ct/an0/ivdX8oYc1UVX860fQDQiMdxRQEAAA==" } } |
デコードコマンド
base64でデコード後、gzip解凍する必要がある
1 |
cat event.json | jq -r .awslogs.data | base64 -d | zcat | jq -r |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
{ "messageType": "DATA_MESSAGE", "owner": "123456789123", "logGroup": "testLogGroup", "logStream": "testLogStream", "subscriptionFilters": [ "testFilter" ], "logEvents": [ { "id": "eventId1", "timestamp": 1440442987000, "message": "[ERROR] First test message" }, { "id": "eventId2", "timestamp": 1440442987001, "message": "[ERROR] Second test message" } ] } |