logstash-plugins / logstash-integration-snmp

Logstash Integration Plugin for SNMP, including SNMP input and SNMP Trap Plugins
Apache License 2.0
0 stars 3 forks source link

"uninitialized constant" exception for invalid column name #31

Open TheVastyDeep opened 10 months ago

TheVastyDeep commented 10 months ago

logstash 8.11.0 with bundled JVM, installed via yum, run on the command line.

If the OID has a space in it, so that it does not match the OID_REGEX then instead of throwing a ConfigurationError it throws an uninitialized constant error.

input {
    snmp {
        hosts => [ {host => "udp:127.1.2.3/161" community => "public" } ]
        tables => [ {"name" => "interfaces" "columns" => ["1.3. .1.2.1.31.1.1.1.10"]} ]
    }
}
output { stdout { codec => rubydebug { metadata => false } } }
filter {}

Pipeline error {:pipeline_id=>"main", :exception=>#, :backtrace=>["org/jruby/RubyModule.java:4309:in const_missing'", "/usr/share/logstash/vendor/bundle/jruby/3.1.0/gems/logstash-input-snmp-1.3.3/lib/logstash/inputs/snmp.rb:312:inblock in validate_oids!'"

It is likely that the other similarly referenced error messages would provoke the same exception.

Throwing out a WAG after looking at source for some other plugins ... missing "require 'java'"?