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

Searchmatch allows using a parameter without double quotes #68

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

Searchmatch allows using a parameter without double quotes #68

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

Comments

@51-code
Copy link
Contributor

51-code commented Aug 21, 2024

Describe the bug

The evaluation function searchmatch() has just one parameter in the grammar, an EvalStatement. Having it as evalStatement allows for using integerType, fieldType and so on as a parameter, even though it should just support double quoted search strings.

It also supports using other evaluation functions as parameter, like:

%dpl
index=abc | eval a = if(searchmatch(avg(offset, 2)), "true", "false")

Expected behavior

Should only support a double quoted string. Don't just use the EvalStringType: the grammar rules should be completely reworked so that the different comparison operators are introduced in their own grammar rules, and not just in a single string rule. Currently the string is parsed in PTH-10, even though that would be a parser responsibility.

Using "foo" + "bar" should still be supported. Meaning, that it should support eval statements, as long as the return type is a string.

How to reproduce

Run a similar query to the one above.

Screenshots

Software version

pth_10 version: 5.5.0-2-g5f9746ea
pth_03 version: 6.1.4

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 21, 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