简体   繁体   中英

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.

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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM