Skip to content

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

@51-code

Description

@51-code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions