-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
enhancement(remap transform): add parse_aws_alb_log
function
#5489
Conversation
Signed-off-by: Kirill Fomichev <fanatid@ya.ru>
parse_aws_elb
functionparse_aws_elb
function
parse_aws_elb
functionparse_aws_elb
function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! I appreciate the benchmarking to motivate the use of nom here.
I think mapping -
to Null
would be appropriate.
src/remap/function/parse_aws_elb.rs
Outdated
#[test] | ||
fn parse_aws_elb() { | ||
let logs = vec![ | ||
r#"http 2018-07-02T22:23:00.186641Z app/my-loadbalancer/50dc6c495c0c9188 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks for including all of their examples.
arguments: [ | ||
{ | ||
name: "value" | ||
description: "Access log of the Application Load Balancer." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we may want to call this parse_aws_alb
(or even parse_aws_alb_log
) instead then to leave room for parsing classic load balancer (ELB) logs (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/access-log-collection.html) and network load balancer (NLB) logs (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-access-logs.html) in the future.
Signed-off-by: Kirill Fomichev <fanatid@ya.ru>
Signed-off-by: Kirill Fomichev <fanatid@ya.ru>
Signed-off-by: Kirill Fomichev <fanatid@ya.ru>
parse_aws_elb
functionparse_aws_alb_log
function
Signed-off-by: Kirill Fomichev <fanatid@ya.ru>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
Signed-off-by: Kirill Fomichev <fanatid@ya.ru>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Closes #5365
I also was curious how nom will be faster than
regex
, so create a simple benchmark:code diff
Results:
parse_aws_elb/nom
returnremap::Value
with allocated dataparse_aws_elb/nom_raw
only consume same data asregex
parse_aws_elb/regex
is regex proposed in #5365.Data allocation should take the nearly same time for both
nom
/regex
but parsing looks like ~7x faster.Some fields can have "no value" as
"-"
, should I useValue::Null
in this case?