logstash-plugins / logstash-filter-date

Apache License 2.0
7 stars 43 forks source link

Parsing invalid TAI64N causes logstash to exit #130

Open TheVastyDeep opened 5 years ago

TheVastyDeep commented 5 years ago

In 6.7.1 on Linux this configuration

    mutate { add_field => { "someField" => "12345678" } }
    date { match => [ "someField", "TAI64N" ] }

causes logstash to exit with

java.lang.StringIndexOutOfBoundsException: String index out of range: 16
        at java.lang.String.substring(java/lang/String.java:1963) ~[?:1.8.0_212]
        at org.logstash.filters.parser.TAI64NParser.parse(org/logstash/filters/parser/TAI64NParser.java:35) ~[logstash-filter-date-3.1.6.jar:?]
        at org.logstash.filters.NumericParserExecutor.execute(org/logstash/filters/NumericParserExecutor.java:37) ~[logstash-filter-date-3.1.6.jar:?]
        at org.logstash.filters.DateFilter.executeParsers(org/logstash/filters/DateFilter.java:108) ~[logstash-filter-date-3.1.6.jar:?]
        at org.logstash.filters.DateFilter.receive(org/logstash/filters/DateFilter.java:79) ~[logstash-filter-date-3.1.6.jar:?]
        at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498) ~[?:1.8.0_212]
        at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:455) ~[jruby-complete-9.2.6.0.jar:?]