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

db-parser prefix() support #4133

Merged
merged 10 commits into from Nov 17, 2022
Merged

Conversation

bazsi
Copy link
Collaborator

@bazsi bazsi commented Sep 14, 2022

This intends to fix #4130

@ryanfaircloth the original idea behind db-parser() was to be the "global" parser for any kind of data. For that reason, I kind of expected all name-value pairs to be specified right within the pattern database. It kind of failed in that mission, today I view db-parser() as a useful alternative to regexps, because it is MUCH faster. But in this role you are right, prefix() would make sense.

These are just a few preparatory patches, but I wanted to submit them so 1) you see there's progress, 2) I can get feedback via the automatic tests.

In the meanwhile, could you please describe your use-case how you'd apply db-parser() to it? It would be useful to learn from. Thanks.

@github-actions
Copy link
Contributor

No news file has been detected. Please write one, if applicable.

@ryanfaircloth
Copy link
Contributor

I'm using it in a way that is close to the original idea. When I extract fields from the message I use a prefix so I can more easily map all of the extracted fields into a destination format ".fields.*" is great when I don't know what the fields will be but I need to map them to json in a destination format

@bazsi
Copy link
Collaborator Author

bazsi commented Sep 18, 2022

This is now pretty much complete. Tests are running locally and now in GitHub CI. Let's see if it turns green.

@ryanfaircloth
Copy link
Contributor

Looks green

@ryanfaircloth
Copy link
Contributor

@bazsi can this be merged?

@bazsi bazsi changed the title WIP: db-parser prefix support db-parser prefix() support Sep 28, 2022
@bazsi
Copy link
Collaborator Author

bazsi commented Sep 28, 2022

removed WIP, rebased and added news file. I am trying to get some reviews so this can be merged.

In the meantime can you perhaps test this if it works for you? The CI produces a set of binaries, so you don't have to compile it yourself. Thanks

@ryanfaircloth
Copy link
Contributor

@bazsi sure how do I get bits from a PR?

@bazsi
Copy link
Collaborator Author

bazsi commented Sep 28, 2022 via email

@ryanfaircloth
Copy link
Contributor

Strange the objects are not downloadable must be a github issue I can try again in a bit

@ryanfaircloth
Copy link
Contributor

@bazsi I was able to download the images my current dev machine is now an apple with M1 I was unable to use the rpm the binary RPMs are x86_64

@MrAnno MrAnno self-requested a review October 13, 2022 12:10
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Remove the duplicated check for stat(db-file).

Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
This allows us to get rid of the use of template->name in this instance.

Also it improves performance as the name-value pair handle is resolved in
init time, instead of at every match.

Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
…arrays

Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
@bazsi
Copy link
Collaborator Author

bazsi commented Nov 17, 2022

rebased against current master

@MrAnno MrAnno merged commit ac81267 into syslog-ng:master Nov 17, 2022
bazsi added a commit that referenced this pull request Nov 24, 2022
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
bazsi added a commit that referenced this pull request Nov 27, 2022
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
bazsi added a commit to bazsi/syslog-ng that referenced this pull request Dec 3, 2022
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
bazsi added a commit that referenced this pull request Dec 5, 2022
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
bazsi added a commit that referenced this pull request Dec 5, 2022
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
MrAnno pushed a commit that referenced this pull request Dec 5, 2022
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
MrAnno pushed a commit that referenced this pull request Dec 5, 2022
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
bazsi added a commit that referenced this pull request Dec 8, 2022
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
bazsi added a commit that referenced this pull request Dec 10, 2022
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
bazsi added a commit that referenced this pull request Dec 15, 2022
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
alltilla pushed a commit that referenced this pull request Dec 15, 2022
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
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.

Improve patterndb parser support prefix()
3 participants