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

if statements error #153

Open
gui66497 opened this issue Dec 10, 2019 · 1 comment
Open

if statements error #153

gui66497 opened this issue Dec 10, 2019 · 1 comment

Comments

@gui66497
Copy link

My origin filter:

filter {
    if ![ipv4] {
        drop{
          id => "drop nmap data"
        }
    }
}

the parser seem to can not understand it and throw an error:

Error in created hook: "Error: Parse error on line 11:
...ter {   if [ipv4] {  drop{  id => "d
---------------------^
Expecting 'BINARY_OPERATOR', got 'START'"

Does the jison paser just do not support this?
So i have to change my conditon to if [ipv4] != null?

@gui66497
Copy link
Author

And in another filter:

filter {
    if [status][state] == "down" {
        elasticsearch {
            user => elastic
            password => changeme
            ...
        }
    }
}

I get another error:

Error: Parse error on line 23:
...  }    if [status][state] == "down" {
---------------------^
Expecting 'START', 'CONDITION_OPERATOR', 'BINARY_OPERATOR', 'PARENTHESIS_STOP', got 'ARRAY_START'

Seem the paser only support one value.
I never touch the jison paser before,so can i solve this kind problem by edit the paser?

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

No branches or pull requests

1 participant