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

Using event fileds in configuration options #161

Open
icetimidus opened this issue Jun 10, 2020 · 1 comment
Open

Using event fileds in configuration options #161

icetimidus opened this issue Jun 10, 2020 · 1 comment
Labels

Comments

@icetimidus
Copy link

May I using logstash evnet fileds in grok filter configuration options?

Such as,

    grok { 
        patterns_dir => ["/opt/logstash/patterns/%{[@metadata][some_filed]}"]
        match => {"message" => "%{SOME_PATTERN}"}
    } 

or

    grok { 
        patterns_dir => ["/opt/logstash/patterns/sub"]
        patterns_files_glob => "%{[@metadata][some_filed]}"
        match => {"message" => "%{SOME_PATTERN}"}
    } 

I have try it in logstash 7.6.1 but faild. Any idea?

@kares
Copy link
Contributor

kares commented May 4, 2021

this isn't supported atm, and I am not sure it ever will be.
the current work-flow is load the pattern definitions once (for performance reasons) before any events are matched.

the closest one could do is having separate grok plugin instances if-ed based on event data e.g.

filter {
  if [some_field] {
    grok {  
      pattern_definitions => {
        "SOME_PATTERN" => '...'
      }
    }
  }
}

@kares kares added the wontfix label May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants