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

[BUG] ppl retruns syntax error when field name is the ppl keyword #712

Closed
cashlalala opened this issue Jul 28, 2022 · 4 comments
Closed
Labels
bug Something isn't working PPL Piped processing language

Comments

@cashlalala
Copy link

What is the bug?
PPL failed to parse when some fileds in log are PPL keywords.

How can one reproduce the bug?

  1. Generate a log like { "log": "test mesg", "timestamp": "2022-07-28 22:45:00" } in index logstash-2022.07.28
  2. Query the data by source=logstash-2022.07.28 | parse log "(?<almsg>\w+).*"
  3. UI shows 400 client error.

What is the expected behavior?
Return parsed fields correctly

What is your host/environment?

  • OS: ubuntu 20.04 (but I run the opensearch & dashboard in docker)
  • Version: opensearch 2.1.0, opensearch-dashboard 2.1.0
  • Plugins: default plugins in docker images opensearch 2.1.0

Do you have any screenshots?
image

Do you have any additional context?
Is there any escape grammar for the scenario? I have tried to find in document but found nothing.
Or please show me the documentation I can refer.

Many thanks!

@cashlalala cashlalala added bug Something isn't working untriaged labels Jul 28, 2022
@Yury-Fridlyand
Copy link
Collaborator

Need to extend keywordsCanBeId in ANTRL for PPL and SQL, see OpenSearchPPLParser.g4 and OpenSearchSQLIdentifierParser.g4:
https://github.com/opensearch-project/sql/blob/main/ppl/src/main/antlr/OpenSearchPPLParser.g4#L486-L492
https://github.com/opensearch-project/sql/blob/main/sql/src/main/antlr/OpenSearchSQLIdentifierParser.g4#L60-L66

@cashlalala
Copy link
Author

Thx! That helps!

@MaxKsyunz
Copy link
Collaborator

@Yury-Fridlyand don't we still need to make this fix?

@Yury-Fridlyand
Copy link
Collaborator

I think yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PPL Piped processing language
Projects
None yet
Development

No branches or pull requests

4 participants