Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple ruby filter in Logstash

I kept running into a wall trying to get a ruby file to work for a filter and I finally simplified my config file to simply this:

filter {
    ruby {
        code => "event.cancel"
    }
}

But even with this simple example, running logstash.bat -t gives me the following:

The given configuration is invalid. Reason: uninitialized constant LogStashCompilerLSCLGrammar::LogStash::Compiler::LSCL::AST::Hash::ConfigurationError

Can anyone point me in the right direction to get a ruby filter to work at all? Same thing happening with fresh install of 6.2.2.

like image 758
DeezCashews Avatar asked May 16 '26 20:05

DeezCashews


1 Answers

Well I should have gone further and simplified even more. I still received the error even after removing then entire ruby { } section which meant my issue was elsewhere. Sorry to waste viewing time. I found my issue with another filters add_field not working correctly. Lesson learned: Make one change at a time and test...

like image 79
DeezCashews Avatar answered May 19 '26 14:05

DeezCashews