SumoLogic / sumologic-aws-lambda

A collection of lambda functions to collect data from Cloudwatch, Kinesis, VPC Flow logs, S3, security-hub and AWS Inspector
Other
152 stars 134 forks source link

Support filter pattern in loggroup lambda connector #165

Open kieran-yio-phx opened 1 year ago

kieran-yio-phx commented 1 year ago

Currently the filter pattern is default to empty ('') and not configurable.

async function createSubscriptionFilter(lambdaLogGroupName, destinationArn, roleArn) {
    if (destinationArn.startsWith("arn:aws:lambda")){
        var params = {
            destinationArn: destinationArn,
            filterName: 'SumoLGLBDFilter',
            filterPattern: '',
            logGroupName: lambdaLogGroupName
        };
    } else {
        var params = {
            destinationArn: destinationArn,
            filterName: 'SumoLGLBDFilter',
            filterPattern: '',
            logGroupName: lambdaLogGroupName,
            roleArn: roleArn
        };
    }

Can we add support to define our filter pattern so that we can selectively ingest the logs?

Thanks