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

grok vague error message when a capture pattern has a field name #5606

Closed
chrismo opened this issue Jan 27, 2025 · 2 comments
Closed

grok vague error message when a capture pattern has a field name #5606

chrismo opened this issue Jan 27, 2025 · 2 comments

Comments

@chrismo
Copy link

chrismo commented Jan 27, 2025

Semi-related to #5605, from an example used there:

$ super -z -c 'yield "foo bar" | grok("%{WORD}", this)'
error({message:"grok(): value does not match pattern",on:"foo bar"})

The error message is a bit vague as to the problem when I have no named capture patterns (if "named capture patterns" is the right nomenclature). If it could mention the missing field_name, that'd be nice.

@philrz
Copy link
Contributor

philrz commented Jan 27, 2025

Hi @chrismo. Hopefully I covered this adequately in my responses to your other questions here. In brief, if it was our intent to require at least one named field in every pattern p parameter to grok(), then I agree this error message would need to be to changed. However, since I believe the current behavior feels like a bug, I think if we make a fix it would no longer return an error in this situation. I'll hold this open and close it once that's confirmed.

@chrismo
Copy link
Author

chrismo commented Jan 27, 2025

yeah, I answered that over there #5605 - I realize on its own now it's sorta silly - but this was in the context of building up a new pattern and wanting some indication that I'd got off to a good start. But I didn't make that clear when posting the issue.

@philrz philrz closed this as completed Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants