We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b095b3f commit 67d783fCopy full SHA for 67d783f
cloudwatch-logs.mjs
@@ -1,7 +1,7 @@
1
import fs from 'fs'
2
import readline from 'readline'
3
import rabbit from './rabbit.js'
4
-import zlib from 'zlib';
+import zlib from 'zlib'
5
6
let counter = 0
7
const lines = []
@@ -23,8 +23,11 @@ async function processLines () {
23
24
export function lambda (e) {
25
const payload = Buffer.from(e.awslogs.data, 'base64')
26
- const data = zlib.gunzipSync(payload).toString('utf8')
27
- console.log(data)
+ const json = JSON.parse(zlib.gunzipSync(payload).toString('utf8'))
+
28
+ for (const logEvent of json.logEvents) {
29
+ console.log('Message:', logEvent.message)
30
+ }
31
setTimeout(rabbit.close, 10000)
32
}
33
0 commit comments