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

Spath doesn't allow specifying the path without "path=" #55

Open
51-code opened this issue Aug 2, 2024 · 0 comments
Open

Spath doesn't allow specifying the path without "path=" #55

51-code opened this issue Aug 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@51-code
Copy link
Contributor

51-code commented Aug 2, 2024

Describe the bug

The following query:
index=index_A | spath json

Doesn't parse the "json" part of the query. With the changes in #52, it gives this error:

line 1:22 extraneous input 'json' expecting <EOF>

If more commands are used after:
index=index_A | spath json | eval a=1

The error expands a bit:

line 1:22 mismatched input 'json' expecting {<EOF>, PIPE, GET_STRING_WILDCARD, GET_STRING_SINGLE_QUOTED, GET_STRING_DOUBLE_QUOTED, GET_STRING_STRING, 'input=', COMMAND_SPATH_MODE_OUTPUT, 'path='}

Furthermore, the eval command is not executed because the parse tree ends in the spath token, which is a valid command in itself. So the spath does print some results, but they are incorrect. Any command afterwards is not executed.

Expected behavior

It can be seen in the grammar that it always requires the "path=" prefix before specifying the path, but it should be optional.

How to reproduce

Run the queries above.

Screenshots

Software version

6.1.0

Desktop (please complete the following information if relevant):

  • OS:
  • Browser:
  • Version:

Additional context

@51-code 51-code added the bug Something isn't working label Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant