Skip to content

Commit da04606

Browse files
authored
Merge pull request #81 from pollosp/master
Adds lambda test event to readme
2 parents 41e2348 + f7a9ff8 commit da04606

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

kinesis/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,66 @@ too loose for production.
5656
</pre>
5757

5858
For the Event Source, pick the stream containing the data you want to send to Sumo.
59+
60+
## Lambda test event
61+
62+
Test event in order to test the Lambda
63+
64+
```json
65+
{
66+
"Records": [
67+
{
68+
"kinesis": {
69+
"partitionKey": "partitionKey-03",
70+
"kinesisSchemaVersion": "1.0",
71+
"data": "H4sICL9JQFwAA2EA3VJNa4MwGL77K0rOdiRRY9KbrK7ssMuUXWYRN0MJqJEkbhTxvy+x4rreB2PvKeT5eJ8nZPQ2doD87LgCuw1AVwP8C9jI00HJoXf4fSOHOleVaK7QzChetbfy8ptbDnrLK222q6ce3vS7Er0RsnsQjeFKW/3rDM6EPddGdJXDwXx7XJQt17o68fzcc7dxn+RJ+ZRmWXJIryKlH7wzPy3H9TSTRO3kAWJRgCAhkDBCGA2CmFLIII5gzCgMsS0SBpgygqIQh5hRjFFE6LJqdTPC5jJV6x5pFmBCowhCeMNb0rvVYwG4S/liu9uWBdgVAN3BoAB+AQbN1WNtUWHOFrFcYwvPnGcpTQEmsBpP/q90ZP+/Ywz/VMfLP/cm7wsfrETjlgMAAA==",
72+
"sequenceNumber": "49545115243490985018280067714973144582180062593244200961",
73+
"approximateArrivalTimestamp": 1428537600
74+
},
75+
"eventSource": "aws:kinesis",
76+
"eventID": "shardId-000000000000:49545115243490985018280067714973144582180062593244200961",
77+
"invokeIdentityArn": "arn:aws:iam::EXAMPLE",
78+
"eventVersion": "1.0",
79+
"eventName": "aws:kinesis:record",
80+
"eventSourceARN": "arn:aws:kinesis:EXAMPLE",
81+
"awsRegion": "us-east-1"
82+
}
83+
]
84+
}
85+
```
86+
87+
88+
You should expect to see a response with an array of records. The Data attribute in an Kinesis record is Base64 encoded and compressed with the gzip format. You can examine the raw data from the command line using the following Unix commands:
89+
90+
`echo -n "<Content of Data>" | base64 -d | zcat`
91+
92+
The Base64 decoded and decompressed data is formatted as JSON with the following structure:
93+
94+
```json
95+
{
96+
"owner": "111111111111",
97+
"logGroup": "CloudTrail",
98+
"logStream": "111111111111_CloudTrail_us-east-1",
99+
"subscriptionFilters": [
100+
"Destination"
101+
],
102+
"messageType": "DATA_MESSAGE",
103+
"logEvents": [
104+
{
105+
"id": "31953106606966983378809025079804211143289615424298221568",
106+
"timestamp": 1432826855000,
107+
"message": "{\"eventVersion\":\"1.03\",\"userIdentity\":{\"type\":\"Root\"}"
108+
},
109+
{
110+
"id": "31953106606966983378809025079804211143289615424298221569",
111+
"timestamp": 1432826855000,
112+
"message": "{\"eventVersion\":\"1.03\",\"userIdentity\":{\"type\":\"Root\"}"
113+
},
114+
{
115+
"id": "31953106606966983378809025079804211143289615424298221570",
116+
"timestamp": 1432826855000,
117+
"message": "{\"eventVersion\":\"1.03\",\"userIdentity\":{\"type\":\"Root\"}"
118+
}
119+
]
120+
}
121+
```

0 commit comments

Comments
 (0)