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

"\." -> "invalid char escape" #2016

Closed
Dieterbe opened this issue Apr 30, 2020 · 2 comments · Fixed by #2095
Closed

"\." -> "invalid char escape" #2016

Dieterbe opened this issue Apr 30, 2020 · 2 comments · Fixed by #2095

Comments

@Dieterbe
Copy link
Contributor

Describe the bug

A clause like |~ "[0-9]*s\" orgID" works fine. note how I'm escaping like \" to match ". This is as expected
However when I update the clause to this:

|~ "\.[0-9]*s\" orgID"

E.g. I merely add \. to match a literal .
It no longer works. I get the error parse error at line 1, col 98: invalid char escape
this is in Grafana v7.1.0-b8976df5pre (55ac97dccc) Explore mode, querying Loki-ops

@rbudiharso
Copy link

A pattern like {container_name="app"} |~ "\s4[00-99]{2}\s" also results in the same error. In this case I want to match HTTP status code like 400 or 401 (its 3 digit with single space around it).

@cyriltovena
Copy link
Contributor

{job="default/prometheus"} |~ "\\s4[00-99]{2}\\s" This works.

@Dieterbe |~ "\\.[0-9]*s\" orgID" this works too.

I've open an issue to improve this see #2061

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

Successfully merging a pull request may close this issue.

3 participants