|
| 1 | +# Kinesis to Sumologic |
| 2 | + |
| 3 | +This function reads messages from a Kinesis |
| 4 | +stream and posts them to a SumoLogic hosted HTTP collector. |
| 5 | + |
| 6 | +## Lambda configuration |
| 7 | + |
| 8 | +There are no module dependencies for this code, so you can paste it into the |
| 9 | +lambda console directly. Note you must set the collector host and the |
| 10 | +path that includes your secret key in options for this to work. |
| 11 | + |
| 12 | +For the Sumo collector configuration, do not enable multiline processing or |
| 13 | +one message per request -- the idea is to send as many messages in one request |
| 14 | +as possible to Sumo and let Sumo break them apart as needed. |
| 15 | + |
| 16 | +In the AWS console, use a code entry type of 'Edit code inline' and paste in the |
| 17 | +code (doublecheck the hostname and path as per your collector setup). |
| 18 | + |
| 19 | +In configuration specify index.handler as the Handler. Specify a Role that has |
| 20 | +sufficient privileges to read from the kinesis stream, invoke a lambda |
| 21 | +function, and write cloud watch logs. I tested with this policy, which is |
| 22 | +too loose for production. |
| 23 | + |
| 24 | +<pre> |
| 25 | +{ |
| 26 | + "Version": "2012-10-17", |
| 27 | + "Statement": [ |
| 28 | + { |
| 29 | + "Effect": "Allow", |
| 30 | + "Action": [ |
| 31 | + "lambda:InvokeFunction" |
| 32 | + ], |
| 33 | + "Resource": [ |
| 34 | + "*" |
| 35 | + ] |
| 36 | + }, |
| 37 | + { |
| 38 | + "Effect": "Allow", |
| 39 | + "Action": [ |
| 40 | + "kinesis:GetRecords", |
| 41 | + "kinesis:GetShardIterator", |
| 42 | + "kinesis:DescribeStream", |
| 43 | + "kinesis:ListStreams", |
| 44 | + "logs:CreateLogGroup", |
| 45 | + "logs:CreateLogStream", |
| 46 | + "logs:PutLogEvents" |
| 47 | + ], |
| 48 | + "Resource": "*" |
| 49 | + } |
| 50 | + ] |
| 51 | +} |
| 52 | +</pre> |
| 53 | + |
| 54 | +For the Event Source, pick the stream containing the data you want to send to Sumo. |
0 commit comments