Get logstash to fail on undefined variable

output {
  file {
    path => "/srv/logstash-logs/%{somevar}.log"
	...

How can I get logstash to fail when an undefined variable is encountered?

Hi

You could try something like this:

output {
  if [somevar] {
    file {
      path => "/srv/logstash-logs/%{somevar}.log"
	  ...
	}
  }
  else {
    <whatever you need to do. If nothing, just omit this "else" alltogether>
 }
}

Hope this helps.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.