Skip to content

fix(syslog): quote payloadKey path to prevent VRL evaluation as expression#3327

Draft
vparfonov wants to merge 3 commits into
openshift:masterfrom
vparfonov:log9562
Draft

fix(syslog): quote payloadKey path to prevent VRL evaluation as expression#3327
vparfonov wants to merge 3 commits into
openshift:masterfrom
vparfonov:log9562

Conversation

@vparfonov

Copy link
Copy Markdown
Contributor

Description

Root Cause:

The payloadKey path (e.g., .message) was injected unquoted into the VRL template:
payload_key = .message # evaluates as VRL expression, reads the VALUE of .message

This resolved .message to its runtime value (e.g., "Hello World"), which was then treated as a field path looking for a field literally named "Hello World", which doesn't exist.

For payloadKey: "{.message}" this only produced noisy warnings (since .message was left unchanged). For any other field (e.g., {.kubernetes.namespace_name}), it silently failed to set .message to the intended value.

Fix:

Quote the path as a string literal and strip the leading dot before splitting:

payload_key = ".message"   # string literal, stays as a path
  if starts_with(payload_key, ".") {
    payload_key = slice!(payload_key, 1)
  }
  path = split!(payload_key, ".")
  value, err = get(., path)

/cc @Clee2691
/assign @jcantrill

Links

…ssion

The payloadKey was injected unquoted into VRL, causing it to be evaluated
as a field access expression rather than kept as a path string. This meant
the resolved value was then re-interpreted as a path via split+get, which
always failed, producing repeated "payload_key not found" warnings.

Fixes: LOG-9562

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Vitalii Parfonov <vparfono@redhat.com>
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 2, 2026
@openshift-ci

openshift-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 34fab123-8acb-492f-afc4-fdb481079265

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci

openshift-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vparfonov
Once this PR has been reviewed and has the lgtm label, please assign jcantrill for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@vparfonov

Copy link
Copy Markdown
Contributor Author

/test functional-target

@vparfonov

Copy link
Copy Markdown
Contributor Author

/test functional-target

@openshift-ci

openshift-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@vparfonov: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/functional-target 43cb3d5 link true /test functional-target

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@vparfonov

Copy link
Copy Markdown
Contributor Author

/test functional-target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant