Skip to content

docs(external): Updated replace capture group example #18785

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

Merged
merged 8 commits into from
Jul 10, 2025

Conversation

pezkins
Copy link
Contributor

@pezkins pezkins commented Oct 5, 2023

updating the example for the capture group name in the example to use $$num instead of $num as single $ does not work. Also need to provide more description on the Note. "Note that $foo is interpreted in a Vector configuration file, instead use $$foo." This isn't clear, and not sure what it means.

updating the example for the capture group name in the example to use $$num instead of $num as single $ does not work. 
Also need to provide more description on the Note.
"Note that $foo is interpreted in a Vector configuration file, instead use $$foo." This isn't clear, and not sure what it means.
@pezkins pezkins requested review from a team as code owners October 5, 2023 18:17
@bits-bot
Copy link

bits-bot commented Oct 5, 2023

CLA assistant check
All committers have signed the CLA.

@netlify
Copy link

netlify bot commented Oct 5, 2023

Deploy Preview for vector-project ready!

Name Link
🔨 Latest commit 603cb7c
🔍 Latest deploy log https://app.netlify.com/sites/vector-project/deploys/652584912a2c260008db22f2
😎 Deploy Preview https://deploy-preview-18785--vector-project.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Oct 5, 2023

Deploy Preview for vrl-playground canceled.

Name Link
🔨 Latest commit 603cb7c
🔍 Latest deploy log https://app.netlify.com/sites/vrl-playground/deploys/65258491aa09e600085d3d8a

@github-actions github-actions bot added the domain: external docs Anything related to Vector's external, public documentation label Oct 5, 2023
@aws-amplify-us-east-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-18785.d1a7j77663uxsc.amplifyapp.com

@aws-amplify-us-east-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-18785.d1hoyoksbulg25.amplifyapp.com

@aws-amplify-us-east-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-18785.d2lr4eds605rpz.amplifyapp.com

@maycmlee maycmlee self-assigned this Oct 5, 2023
Copy link
Member

@jszwedko jszwedko left a comment

Choose a reason for hiding this comment

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

This is a bit tricky because the example is correct, as-is, when used outside of a Vector configuration file (e.g. vector vrl or the VRL playground). It is just that in configuration files you need to escape the $ to avoid it being interpreted as an environment variable.

I think the title of this example should be updated to indicate that this is how it should be written when in a config file only.

@jszwedko jszwedko mentioned this pull request Oct 6, 2023
Added additional example for Replace with capture group to give an example of calling capture groups in a configuration file and outside a configuration file so it is clear.
@pezkins
Copy link
Contributor Author

pezkins commented Oct 6, 2023

@jszwedko I've updated the the pull request so it has an example of both with the titles updated

Copy link
Member

@jszwedko jszwedko left a comment

Choose a reason for hiding this comment

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

Thanks @pezkins !

Copy link
Contributor

@maycmlee maycmlee left a comment

Choose a reason for hiding this comment

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

Thanks both! Just a couple of some edits for clarification. Let me know if I changed the meaning.

Copy link
Contributor

@maycmlee maycmlee left a comment

Choose a reason for hiding this comment

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

Thanks @pezkins, LGTM!

@jszwedko jszwedko enabled auto-merge October 10, 2023 18:06
@pezkins
Copy link
Contributor Author

pezkins commented Oct 11, 2023

wait do the examples actually get tested (which makes sense) but that means that the "in configuration" file example can't fails as the task probably just tests the example with vre/playground. @jszwedko what happens now?

@jszwedko
Copy link
Member

wait do the examples actually get tested (which makes sense) but that means that the "in configuration" file example can't fails as the task probably just tests the example with vre/playground. @jszwedko what happens now?

Ah, yes, I forgot the examples are tested in CI. I would back out the added example then and just add a note to the existing one that an extra $ is needed to escape the $ when using the VRL expression in a Vector configuration file.

@pront pront force-pushed the master branch 4 times, most recently from 1720078 to ffe54be Compare July 10, 2025 15:43
@pront pront changed the title docs: examples!: Updated replace.cue capture group example docs(external): Updated replace capture group example Jul 10, 2025
@jszwedko jszwedko added this pull request to the merge queue Jul 10, 2025
Merged via the queue into vectordotdev:master with commit 18f3055 Jul 10, 2025
41 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: external docs Anything related to Vector's external, public documentation editorial review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants