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

[UnmarshalJSON] check if line startsWith { #986

Open
LaurenceJJones opened this issue Feb 27, 2024 · 1 comment
Open

[UnmarshalJSON] check if line startsWith { #986

LaurenceJJones opened this issue Feb 27, 2024 · 1 comment
Assignees

Comments

@LaurenceJJones
Copy link
Contributor

adding this as a maybe task due to logging of errors.

Following crowdsecurity/crowdsec#2859 (comment) it might be a good idea to check if the line actually started with { if not then dont try to unmarshal json it as the user get bombarded with errors

@LaurenceJJones
Copy link
Contributor Author

Also another task to add is adding type safety checks within all json parsers

time="2024-03-12T11:03:21Z" level=warning msg="failed to run RunTimeValue : cannot fetch 0 from <nil> (1:52)\n | evt.Unmarshaled.caddy.request.headers['User-Agent'][0]\n | ...................................................^" id=dry-frog name=crowdsecurity/caddy-logs stage=s01-parse
time="2024-03-12T11:03:21Z" level=warning msg="failed to run RunTimeValue : cannot fetch 0 from <nil> (1:52)\n | evt.Unmarshaled.caddy.request.headers['User-Agent'][0]\n | ...................................................^" id=dry-frog name=crowdsecurity/caddy-logs stage=s01-parse

@LaurenceJJones LaurenceJJones self-assigned this Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant