Skip to content

filtering ALB logs doesn't work using loki stage configs with Cloud Formation deployment #111

@radumalica

Description

@radumalica

I am using the latest release for this lambda from this repo, built the container and uploaded it to our private AWS ECR repo. Then deployed to AWS as lambda via Cloud Formation, i used the example here for Eventbridge and modified it to match my infrastructure.

All ALB logs are written to S3, then Eventbridge signals lambda to pull them and forward them to Loki. All works fine, except that i have some logs that i would like to filter with regex , things such as "ELB-Healthchecker" and other paths .

I am using terraform to deploy the CF template , and pass the lambda-promtail variables with this. Everything works properly, loki-user, secret_id, extra_labels.

I did some digging in your code, and found loki_stages.go and the associated tests so i added to my pushed variables the following:

loki_stage_configs = jsonencode([ { drop = { expression = ".*ELB-Healthchecker.*" } } ])

It's not erroring out, but it doesn't do anything either, and could not find anything related in the documentation.

Can you point me in the right direction ? Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions