Skip to content

VictoriaLogs: Docs: Incorrect example for conditional replace, excessive word replace #287

Description

@p5i

Describe the bug

Hi
There is the example

_time:5m | replace if (user_type:=admin) replace ("secret", "***") at password

in LogsQL documentation https://docs.victoriametrics.com/victorialogs/logsql/#conditional-replace.
The second word 'replace' is excessive.
You'll receive cannot parse 'replace' pipe: missing '(' after 'replace' error if follow the example. After removing 'replace' the example is working as expected.

According to code
https://github.com/VictoriaMetrics/VictoriaMetrics/blob/v0.33.0-victorialogs/lib/logstorage/pipe_replace.go#L92 there should be '(' after the condition, not 'replace'.

The same typo in the conditional replace_regexp example: https://docs.victoriametrics.com/victorialogs/logsql/#conditional-replace_regexp

To Reproduce

See docs https://docs.victoriametrics.com/victorialogs/logsql/#conditional-replace and follow the example.

Version

$ /opt/victoria-logs-prod --version
victoria-logs-20241001-115230-tags-v0.33.0-victorialogs-0-g234c81754e

Logs

No response

Screenshots

No response

Used command-line flags

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions