Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init: add multiline_parser #486

Merged
merged 1 commit into from Oct 5, 2023

Conversation

konoui
Copy link
Contributor

@konoui konoui commented Nov 21, 2022

Issue #, if available:
#537

Description of changes:
The init process should handle MULTILINE_PARSER in the same way as PARSER.

Currently, a validation error will occur in fluent bit.
https://github.com/fluent/fluent-bit/blob/v2.0.5/src/fluent-bit.c#L862

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@konoui konoui requested a review from a team as a code owner November 21, 2022 09:36
Copy link
Contributor

@PettitWesley PettitWesley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@konoui Thank You!

Next step: Someone from our team needs to pull this change and test it before we merge. @matthewfala @Claych

@PettitWesley
Copy link
Contributor

Sorry we have neglected this. I will work on running the integ test soon.

@kakakakakku
Copy link

@PettitWesley
Hi, Do you have any plans to release this pull request? I'm also encountering the same error, so it would be really helpful if this could be merged soon😀 Thanks.

@PettitWesley
Copy link
Contributor

@kakakakakku I apologize, this has been on my backlog for a while, but I've been backed up with different high impact issues/bugs/fixes.

I've bumped the priority on my backlog for this... sorry that's all I can do for now :(

@fermani
Copy link

fermani commented Sep 15, 2023

Is there any chance to get this merged? We had to build a custom image with the workaround described at #537 (comment). It is not a big deal but we prefer to have this feature in the init tag image by default.

Thank you.

@PettitWesley
Copy link
Contributor

I completed testing with the following. I checked that the files were downloaded and that FLB started up and ran and checked the entrypoint.

            "environment": [
                {
                    "name": "aws_fluent_bit_init_s3_1",
                    "value": "arn:aws:s3:::firenosed-dolphin-bucket/dummy-input.conf"
                },
                {
                    "name": "aws_fluent_bit_init_s3_2",
                    "value": "arn:aws:s3:::firenosed-dolphin-bucket/multiline-parser.conf"
                },
                {
                    "name": "aws_fluent_bit_init_s3_3",
                    "value": "arn:aws:s3:::firenosed-dolphin-bucket/multiline-filter.conf"
                }
            ],
[MULTILINE_PARSER]
    name          multiline-regex-test
    type          regex
    flush_timeout 1000
    # Regex rules for multiline parsing
    # ---------------------------------
    #
    # configuration hints:
    #
    #  - first state always has the name: start_state
    #  - every field in the rule must be inside double quotes
    #
    # rules   |   state name   | regex pattern                   | next state name
    # --------|----------------|--------------------------------------------------
    rule         "start_state"   "/(Dec \d+ \d+\:\d+\:\d+)(.*)/"  "cont"
    rule         "cont"          "/^\s+at.*/"                     "cont"
[FILTER]
    name                  multiline
    match                 *
    multiline.key_content message
    multiline.parser      go, multiline-regex-test

Resulting entrypoint:

exec /fluent-bit/bin/fluent-bit -e /fluent-bit/firehose.so -e /fluent-bit/cloudwatch.so -e /fluent-bit/kinesis.so -c /init/fluent-bit-init.conf -R /init/fluent-bit-init-s3-files/multiline-parser.conf

@PettitWesley
Copy link
Contributor

Thanks @konoui and apologies that we took soooo long to merge this!

@PettitWesley PettitWesley merged commit d5d2b0e into aws:mainline Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants