Skip to content
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

Support include_brackets feature just like Logstash KV filter #21918

Open
tiantangkuohai opened this issue Nov 29, 2024 · 2 comments
Open

Support include_brackets feature just like Logstash KV filter #21918

tiantangkuohai opened this issue Nov 29, 2024 · 2 comments
Labels
type: feature A value-adding code addition that introduce new functionality.

Comments

@tiantangkuohai
Copy link

tiantangkuohai commented Nov 29, 2024

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

Use Cases

We have some log field like this:

{"detail": "query=[select 1 from table1] component=[aggregator] msg=[begin to send query to \[mysql.foo.com\]]"}

In logstash, it can parse the fields in detail field value using KV filter. But it seems that Vector doesn't have similar feature.

Attempted Solutions

I tries with parse_key_value and parse_regex_all. Both of them can't working perfectly.

Proposal

No response

References

No response

Version

0.42.0

@tiantangkuohai tiantangkuohai added the type: feature A value-adding code addition that introduce new functionality. label Nov 29, 2024
@pront
Copy link
Member

pront commented Dec 2, 2024

Hi @tiantangkuohai,

  • Does this log come from the Logstash agent?
  • Are you suggesting to implement this parsing logic in the logstash source?

@jszwedko
Copy link
Member

jszwedko commented Dec 2, 2024

I think this could be supported by enabling configuration of the expected "quote" characters in parse_key_value. I believe that parse_key_value currently expects keys/values to be quoted with "s (if quoted at all). We could allow configuration of quotes as brackets instead. Something like: parse_key_value(.message, start_quote: "[", end_quote: "]").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A value-adding code addition that introduce new functionality.
Projects
None yet
Development

No branches or pull requests

3 participants