feat(stdlib): Add support for parsing nginx error_log_tag#1816
feat(stdlib): Add support for parsing nginx error_log_tag#1816JakubOnderka wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ed45abdfa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
7ed45ab to
a3074c1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3074c1c0e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| (,\s+upstream:\s+"(?P<upstream>[^"]*)")? # Match any character after ', upstream: ' | ||
| (,\s+host:\s+"(?P<host>[^"]*)")? # Match any character then ':' then any character after ', host: ' | ||
| (,\s+refer?rer:\s+"(?P<referer>[^"]*)")? # Match any character after ', referrer: ' | ||
| (,\s+(?P<tags>([\w-]+:\s+"([^"]*)",?\s*)*))? # Match any additional tags |
There was a problem hiding this comment.
Accept dotted error_log_tag names
For configurations that use a tag name outside [\w-] (for example error_log_tag trace.id $request_id;), this optional suffix will not match. Because the preceding message group can expand to the end while the context groups remain optional, parse_nginx_log still succeeds but folds the whole , client: ... , trace.id: "..." suffix into message and drops client/host/tags. Fresh evidence: the current patch only widens the tag-name class to hyphens, so dotted names still take this path.
Useful? React with 👍 / 👎.
Summary
nginx Plus supports
error_log_tagoption that can add additional tags to nginx error log. When these tags are present, parse_nginx_log fails to properly parse that log. After this change, unparsed additional tags will be included intagsfields. User can then parse them for example byparse_key_valuefunction.It also fixes type defs to match reality.
Change Type
Is this a breaking change?
How did you test this PR?
Does this PR include user facing changes?
our guidelines.
Checklist
run
dd-rust-license-tool writeand commit the changes. More details here.