Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java error : EmptyMap cannot be cast to org.logstash.ConvertedList #137

Open
lovasoa opened this issue Mar 27, 2018 · 1 comment
Open

java error : EmptyMap cannot be cast to org.logstash.ConvertedList #137

lovasoa opened this issue Mar 27, 2018 · 1 comment

Comments

@lovasoa
Copy link

lovasoa commented Mar 27, 2018

Hello,
I have a java error when I try to start logstash with geoip

Stacktrace

[2018-03-27T21:13:21,375][ERROR][logstash.pipeline        ] Exception in pipelineworker, the pipeline stopped processing new events, please check your filter configuration and restart Logstash.

{

:pipeline_id=>"main",

 "exception"=>"java.util.Collections$EmptyMap cannot be cast to org.logstash.ConvertedList", 

"backtrace"=>[
"org.logstash.Accessors.setChild(org/logstash/Accessors.java:107)", 
"org.logstash.Accessors.set(org/logstash/Accessors.java:16)",
"org.logstash.Event.setField(org/logstash/Event.java:159)", 
"org.logstash.Event.setField(org/logstash/Event.java:150)", 
"org.logstash.filters.GeoIPFilter.applyGeoData(org/logstash/filters/GeoIPFilter.java:185)", 
"org.logstash.filters.GeoIPFilter.handleEvent(org/logstash/filters/GeoIPFilter.java:167)", 
"java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)", 
"org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:453)", 
"org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:314)", 
"RUBY.filter(/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-filter-geoip-5.0.3-java/lib/logstash/filters/geoip.rb:111)", 
"RUBY.do_filter(/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:145)", 
"RUBY.block in multi_filter(/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:164)", 
"org.jruby.RubyArray.each(org/jruby/RubyArray.java:1734)", 
"org.jruby.RubyArray$INVOKER$i$0$0$each.call(org/jruby/RubyArray$INVOKER$i$0$0$each.gen)", 
"RUBY.multi_filter(/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:161)", 
"RUBY.multi_filter(/usr/share/logstash/logstash-core/lib/logstash/filter_delegator.rb:47)", 
"RUBY.block in filter_func((eval):94)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)", 
"RUBY.filter_batch(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:447)", 
"RUBY.worker_loop(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:426)", 
"RUBY.block in start_workers(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:385)", 
"org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)", 
"org.jruby.RubyProc.call(org/jruby/RubyProc.java:246)", 
"java.lang.Thread.run(java/lang/Thread.java:748)"],

:thread=>"#<Thread:0xe35c8cb@/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:246 sleep>"
}

System info

  • Version: 6.2.3
  • Operating System: Fedora 27
  • Config File :
input {
  http {
    port => 9494
    codec => json
  }
}

filter {
  geoip {
    source => "host"
    target => "[@metadata][geoip]"
  }
  date {
    match => [ "time", "MMM dd, YYYY HH:mm:ss", "ISO8601"]
    locale => "en_US"
    timezone => "%{[@metadata][geoip][timezone]}"
  }
  if ![location] {
    mutate {
       copy => { "[@metadata][geoip][location]" => "location" }
    }
  }
}

output {
  elasticsearch {
    index => "ruuvi_station_logstash_%{+YYYY.MM.dd}"
    document_type => "_doc"
  }
}
  • Sample Data:
{
    "tag": {
      "temperature": 16.2,
      "updateAt": "Mar 27, 2018 20:47:16",
      "voltage": 2.959,
      "accelX": 0.012,
      "favorite": true,
      "id": "...",
      "pressure": 1000.66,
      "humidity": 55,
      "rawDataBlob": {
        "blob": []
      },
      "gatewayUrl": "...",
      "accelY": 0.052,
      "name": "balcon",
      "accelZ": 1.036,
      "defaultBackground": 2,
      "rssi": -74
    },
    "time": "Mar 27, 2018 20:47:16",
    "@version": "1",
    "deviceId": "...",
    "@timestamp": "2018-03-27T18:47:16.000Z",
    "host": "87.116.17.19",
    "headers": {
      "http_user_agent": "...",
      "http_host": "...",
      "http_accept": "*/*",
      "content_type": "application/json",
      "http_accept_encoding": "gzip, deflate",
      "request_path": "/",
      "content_length": "477",
      "request_method": "POST",
      "request_uri": "/",
      "http_connection": "keep-alive",
      "http_version": "HTTP/1.1"
    },
    "eventId": "..."
  }
@lovasoa lovasoa changed the title java.util.Collections$EmptyMap cannot be cast to org.logstash.ConvertedList java error : EmptyMap cannot be cast to org.logstash.ConvertedList Mar 27, 2018
@lovasoa
Copy link
Author

lovasoa commented Mar 27, 2018

See:

event.setField(targetField, Collections.emptyMap());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant