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

Parse escape sequence for string and display errors #475

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

trueleo
Copy link
Contributor

@trueleo trueleo commented Aug 16, 2023

Description

Adds ability to escape ", \n, ..etc when defining string rules.

Use existing verbose error type from nom to display error. The error type usually will contains stack trace for parser and their subparser.

To customize error any further, this will require a custom nom error type.

Error Example

failed to set alert configuration for log stream app due to err: 0: at line 1, in IsNot:
(verb =% "\list" or verb =% "get") and (objectRef_resource = "secrets" and user_username =% "admin")
          ^

1: at line 1, in Alt:
(verb =% "\list" or verb =% "get") and (objectRef_resource = "secrets" and user_username =% "admin")
          ^
failed to set alert configuration for log stream app due to err: 0: at line 1:
(verb =% "list" or) and (objectRef_resource = "secrets" and user_username =% "admin")
                ^
expected ')', found o



This PR has:

  • been tested to ensure log ingestion and log query works.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added documentation for new or modified features or behaviors.

@nitisht nitisht merged commit dd7cd21 into parseablehq:main Aug 16, 2023
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 16, 2023
@trueleo trueleo deleted the composite_alert branch August 17, 2023 11:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants