vectordotdev / vectordotdev/vector

chore(docs): update docs for VRL's `replace` to explain escaping capture group references

Open Beginner friendly
#13,949 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

domain: external docs domain: vrl
Dominant language
Rust
Stars
22.6k
Forks
2.3k
Avg merge
1d 7h
Merged PRs (30d)
146

Description

The VRL replace function allows specifying capture group references in the replacement string, which works fine when following the examples in the VRL documentation. Specifically, the examples cover using a single group reference.

However, the documentation/examples do not cover how to use the group references when there is no whitespace surrounding them, which requires curly brackets to disambiguate. Without braces, something like $$ref1strhere$$ref2 ends up simply getting replaced as if the replacement value was $$ref2... whereas $${ref1}strhere$${ref2} works as expected.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the VRL replace documentation and its existing capture-group examples. Add an example explaining curly-braced references when capture groups are adjacent to other text, and confirm the documentation clearly contrasts the ambiguous and disambiguated replacement strings.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.