Shipping all logs to ELK

The cloudwatchLog event source monitors log groups and then streams them to your Lambda function. So in your case, you’d want to configure your log-shipper function with a cloudwatchLog event for each function you want to stream to log-shipper.

For example:

 functions:
  log-shipper:
    handler: # your handler
    events: # The Events that trigger this Function
        - cloudwatchLog:
            logGroup: '/aws/lambda/func1-to-stream'
            filter: ''
        - cloudwatchLog:
            logGroup: '/aws/lambda/func2-to-stream'
            filter: ''
        - cloudwatchLog:
            logGroup: '/aws/lambda/func3-to-stream'
            filter: ''

This will create subscriptions to those log groups and send them all to log-shipper. Note that you are limited to ONE subscription per log group, so this would be the only function that will monitor them.

1 Like