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

Multiline Parser: Custom parser cannot replicate built-in CRI parser? #4033

Closed
pranavmarla opened this issue Aug 31, 2021 · 7 comments
Closed
Labels

Comments

@pranavmarla
Copy link

pranavmarla commented Aug 31, 2021

Bug Report

Describe the bug
As per this multiline parsing doc, Fluent Bit now comes with some built-in multiline parsers and also gives us the ability to create our own custom multiline parsers.

Unfortunately, it looks like the custom parser functionality is not as powerful as the built-in parsers, which means that, for some of the built-in multiline parsers (eg. CRI), it is not currently possible to create a custom multiline parser that replicates/reproduces its functionality.

This means that, if we want to modify the built-in CRI multiline parser by creating our own custom CRI multiline parser, that is not currently possible.

If this is a known limitation, which I believe it is (see below for details), is there an ETA for when this will be fixed?

If I am mistaken, and it is possible right now, could you please provide the config for a custom multiline parser that does the same thing as the built-in CRI multiline parser?

Proof
1.
Reading through the documentation on regex states, needed to create a custom multiline parser, it appears that it can only catch multiline logs where the first line is formatted differently from the subsequent lines:
i.e.

A
B
B
B
...

But, as mentioned in #1316, CRI multiline logs follow the opposite format:

A
A
A
...
B

So, based off of my interpretation, it doesn't seem possible to create a custom regex multiline parser that can match CRI multiline logs.

2.
In the custom multiline parser doc, I see this explanation of one of the parameters:

type: Set the multiline mode, for now, we support the type regex.

Initially, this didn't convey anything to me, since there's no mention of how many other types there are, or what those other types are.
However, I later found some types mentioned here:

/* Types available */
#define FLB_ML_REGEX     1    /* pattern is a regular expression    */
#define FLB_ML_ENDSWITH  2    /* record key/content ends with 'abc' */
#define FLB_ML_EQ        3    /* record key/content equaks 'abc'    */

Assuming the documentation is referring to these types, then it implies that we can only create custom multiline parsers that replicate built-in parsers of the first type (regex) -- CRI by contrast, is the last type (equals).

Based on this, this appears to be a known limitation.

Your Environment

  • Version used: 1.8.4

Additional context
As mentioned above, this is an issue primarily because it means we cannot make any modifications to the built-in CRI multi-line parsers (by building our own custom parsers).
By contrast, if we consider the regular (single-line) parsers, it is possible to make our own custom parser that can replicate any of the built-in parsers (including CRI).

@pranavmarla
Copy link
Author

If this is a known limitation, which I believe it is (see below for details), is there an ETA for when this will be fixed?

FYI @edsiper: When you have time, would you mind providing an ETA for when the custom multiline parser functionality will be on par with the built-in parsers?

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2021

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added Stale and removed Stale labels Nov 12, 2021
@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@github-actions github-actions bot added the Stale label Feb 25, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2022

This issue was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this as completed Mar 2, 2022
@pmalek-sumo
Copy link

I believe this is not stale.

@gnom7
Copy link

gnom7 commented Oct 23, 2023

@pranavmarla @edsiper any guidance please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants