-
Notifications
You must be signed in to change notification settings - Fork 477
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
geoip2: extend with template option #3051
Conversation
Signed-off-by: Kokan <[email protected]>
Right now only `template()` is included with the parser_opt rule, but this also allows any other future enhancements. Signed-off-by: Kokan <[email protected]>
Signed-off-by: Kokan <[email protected]>
Signed-off-by: Kokan <[email protected]>
Signed-off-by: Kokan <[email protected]>
After this patch providing a format string after opening bracket became optional, and the following are equal: ``` geoip2("format-string"); geoip2(format-string); geoip2(template("format-string")); ``` Signed-off-by: Kokan <[email protected]>
Build SUCCESS |
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.
Nicely done. It should have been implemented originally with the template option.
@furiel do you think marking |
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.
Awesome :)
Opposed to parsers that by default uses
MESSAGE
and that could be further specialised withtemplate()
options, thegeoip2
always usestemplate
. That is enforced with the grammar rule always requiring a template in a form of string:geoip2("template-format")
.The PR includes the following changes:
geoip2
grammer with generalparse_opt
rules (currently only includestemplate()
template
template()
opposed to usingMESSAGE
field, that works for any parser, but never actually used in case ofgeoip2
As a results both are possible configuration option: