{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/logstash/issues/5137","repository_url":"https://api.github.com/repos/elastic/logstash","labels_url":"https://api.github.com/repos/elastic/logstash/issues/5137/labels{/name}","comments_url":"https://api.github.com/repos/elastic/logstash/issues/5137/comments","events_url":"https://api.github.com/repos/elastic/logstash/issues/5137/events","html_url":"https://github.com/elastic/logstash/issues/5137","id":149422565,"number":5137,"title":"Logstash Core Event Java vs Ruby have different behavior","user":{"login":"driverpt","id":1164534,"avatar_url":"https://avatars.githubusercontent.com/u/1164534?v=3","gravatar_id":"","url":"https://api.github.com/users/driverpt","html_url":"https://github.com/driverpt","followers_url":"https://api.github.com/users/driverpt/followers","following_url":"https://api.github.com/users/driverpt/following{/other_user}","gists_url":"https://api.github.com/users/driverpt/gists{/gist_id}","starred_url":"https://api.github.com/users/driverpt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/driverpt/subscriptions","organizations_url":"https://api.github.com/users/driverpt/orgs","repos_url":"https://api.github.com/users/driverpt/repos","events_url":"https://api.github.com/users/driverpt/events{/privacy}","received_events_url":"https://api.github.com/users/driverpt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elastic/logstash/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-04-19T10:50:42Z","updated_at":"2016-04-19T18:02:18Z","closed_at":null,"body":"I detected a bug on logstash-core-event-java.\r\n\r\nWe have Pure Java-libraries performing all the Filtering and we do a small \"hack\" to have @metadata inside the event:\r\n\r\n`@some_filter.filter event.to_hash, event[\"@metadata\"]`\r\n\r\nAnd within the Java Filter object, we just put the metadata map inside the event so that we have a Map for everything\r\n\r\n```\r\nprivate static final String METADATA_FIELDREF = \"@metadata\";\r\n\r\n@Override\r\npublic void filter(Map<String, Object> eventData, Map<String, Object> metaData) {\r\n  eventData.put(METADATA_FIELDREF, metaData);\r\n  doFilter(eventData);\r\n  eventData.remove(METADATA_FIELDREF);\r\n}\r\n```\r\n\r\nThis behaviour occurs only on logstash-core-event-java, and this got fixed by switching back to logstash-core-event library."},"comment":{"url":"https://api.github.com/repos/elastic/logstash/issues/comments/212045731","html_url":"https://github.com/elastic/logstash/issues/5137#issuecomment-212045731","issue_url":"https://api.github.com/repos/elastic/logstash/issues/5137","id":212045731,"user":{"login":"colinsurprenant","id":2010,"avatar_url":"https://avatars.githubusercontent.com/u/2010?v=3","gravatar_id":"","url":"https://api.github.com/users/colinsurprenant","html_url":"https://github.com/colinsurprenant","followers_url":"https://api.github.com/users/colinsurprenant/followers","following_url":"https://api.github.com/users/colinsurprenant/following{/other_user}","gists_url":"https://api.github.com/users/colinsurprenant/gists{/gist_id}","starred_url":"https://api.github.com/users/colinsurprenant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinsurprenant/subscriptions","organizations_url":"https://api.github.com/users/colinsurprenant/orgs","repos_url":"https://api.github.com/users/colinsurprenant/repos","events_url":"https://api.github.com/users/colinsurprenant/events{/privacy}","received_events_url":"https://api.github.com/users/colinsurprenant/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T18:02:18Z","updated_at":"2016-04-19T18:02:18Z","body":"@driverpt not sure how/where you read that? It is actually the opposite, all the work we do on the Java Event implementation and future Java pipeline implementation is to move toward providing support for pure Java plugin implementations, or any other JVM languages for that respect, by providing a pure Java API. This is done in an iterative way and we haven't yet defined how a Java plugins could/should be written *today* by leveraging the Java Event (for this #5032 might be interesting). In the short term is it not really possible to completely avoid all Ruby but you can certainly go a long way in having most of your filter logic in Java.\r\n\r\nSo, basically, you are a bit ahead of the curve here :P but this is also a good opportunity to work with you and see what work or not so please do not hesitate to ask questions, we will help as much as we can but do not expect immediate answers, as @guyboertje noted.\r\n\r\nFor your Maven request, I will followup shortly in that issue. "}}