Skip to content

feat(stdlib): Add support for parsing nginx error_log_tag#1816

Open
JakubOnderka wants to merge 1 commit into
vectordotdev:mainfrom
JakubOnderka:nginx-log-tags
Open

feat(stdlib): Add support for parsing nginx error_log_tag#1816
JakubOnderka wants to merge 1 commit into
vectordotdev:mainfrom
JakubOnderka:nginx-log-tags

Conversation

@JakubOnderka

Copy link
Copy Markdown
Contributor

Summary

nginx Plus supports error_log_tag option 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 in tags fields. User can then parse them for example by parse_key_value function.

It also fixes type defs to match reality.

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

How did you test this PR?

cargo test

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on
    our guidelines.
  • No. A maintainer will apply the "no-changelog" label to this PR.

Checklist

@JakubOnderka JakubOnderka requested a review from a team as a code owner June 13, 2026 09:29

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/stdlib/log_util.rs Outdated
Comment thread src/stdlib/parse_nginx_log.rs
@JakubOnderka JakubOnderka changed the title feat(stdlib): Add support parsing nginx error_log_tag feat(stdlib): Add support for parsing nginx error_log_tag Jun 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/stdlib/log_util.rs
(,\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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@pront pront added the stdlib: parse_nginx_log VRL stdlib function: parse_nginx_log label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stdlib: parse_nginx_log VRL stdlib function: parse_nginx_log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants