Skip to content

parse_key_value failed when string ends with delimiter #1536

@alexeynl

Description

@alexeynl

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

parse_key_value VRL function failed with the following real world linux auth log example:

parse_key_value!("TTY=unknown ; PWD=/ ; USER=postgres ; COMMAND=/usr/pgsql-10/bin/psql;", key_value_delimiter: "=", field_delimiter: ";")

I'm getting could not parse whole line successfully error

It is successfully parsed same string but with removed delimiter ";" at the end of string:

parse_key_value!("TTY=unknown ; PWD=/ ; USER=postgres ; COMMAND=/usr/pgsql-10/bin/psql", key_value_delimiter: "=", field_delimiter: ";")

Configuration


Version

0.50

Debug Output


Example Data

TTY=unknown ; PWD=/ ; USER=postgres ; COMMAND=/usr/pgsql-10/bin/psql;

Additional Context

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions