{"action":"created","issue":{"url":"https://api.github.com/repos/logstash-plugins/logstash-filter-date/issues/4","labels_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-date/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-date/issues/4/comments","events_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-date/issues/4/events","html_url":"https://github.com/logstash-plugins/logstash-filter-date/pull/4","id":53548356,"number":4,"title":"better year handling when format does not contain year","user":{"login":"jsvd","id":31809,"avatar_url":"https://avatars.githubusercontent.com/u/31809?v=3","gravatar_id":"","url":"https://api.github.com/users/jsvd","html_url":"https://github.com/jsvd","followers_url":"https://api.github.com/users/jsvd/followers","following_url":"https://api.github.com/users/jsvd/following{/other_user}","gists_url":"https://api.github.com/users/jsvd/gists{/gist_id}","starred_url":"https://api.github.com/users/jsvd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsvd/subscriptions","organizations_url":"https://api.github.com/users/jsvd/orgs","repos_url":"https://api.github.com/users/jsvd/repos","events_url":"https://api.github.com/users/jsvd/events{/privacy}","received_events_url":"https://api.github.com/users/jsvd/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/logstash-plugins/logstash-filter-date/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"purbon","id":68540,"avatar_url":"https://avatars.githubusercontent.com/u/68540?v=3","gravatar_id":"","url":"https://api.github.com/users/purbon","html_url":"https://github.com/purbon","followers_url":"https://api.github.com/users/purbon/followers","following_url":"https://api.github.com/users/purbon/following{/other_user}","gists_url":"https://api.github.com/users/purbon/gists{/gist_id}","starred_url":"https://api.github.com/users/purbon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purbon/subscriptions","organizations_url":"https://api.github.com/users/purbon/orgs","repos_url":"https://api.github.com/users/purbon/repos","events_url":"https://api.github.com/users/purbon/events{/privacy}","received_events_url":"https://api.github.com/users/purbon/received_events","type":"User","site_admin":false},"milestone":null,"comments":12,"created_at":"2015-01-06T18:49:00Z","updated_at":"2015-08-07T13:52:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/logstash-plugins/logstash-filter-date/pulls/4","html_url":"https://github.com/logstash-plugins/logstash-filter-date/pull/4","diff_url":"https://github.com/logstash-plugins/logstash-filter-date/pull/4.diff","patch_url":"https://github.com/logstash-plugins/logstash-filter-date/pull/4.patch"},"body":"if the time format does not have year then:\r\n\r\n* use local year if month is the same as current one\r\n* use previous year if current month is January but event is December\r\n* use next year if current month is December but event is January\r\n* use local year otherwise\r\n\r\nfixes #3 \r\n\r\nhas very little impact on formats that have year.\r\nFor year-less formats there's extra allocation overhead per event (Time.now, time parsing is no longer direct to long, has to go through 2 DateTime objects)\r\n\r\nPerformance impact for this change was not analyzed."},"comment":{"url":"https://api.github.com/repos/logstash-plugins/logstash-filter-date/issues/comments/128704430","html_url":"https://github.com/logstash-plugins/logstash-filter-date/pull/4#issuecomment-128704430","issue_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-date/issues/4","id":128704430,"user":{"login":"ph","id":640,"avatar_url":"https://avatars.githubusercontent.com/u/640?v=3","gravatar_id":"","url":"https://api.github.com/users/ph","html_url":"https://github.com/ph","followers_url":"https://api.github.com/users/ph/followers","following_url":"https://api.github.com/users/ph/following{/other_user}","gists_url":"https://api.github.com/users/ph/gists{/gist_id}","starred_url":"https://api.github.com/users/ph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ph/subscriptions","organizations_url":"https://api.github.com/users/ph/orgs","repos_url":"https://api.github.com/users/ph/repos","events_url":"https://api.github.com/users/ph/events{/privacy}","received_events_url":"https://api.github.com/users/ph/received_events","type":"User","site_admin":false},"created_at":"2015-08-07T13:52:58Z","updated_at":"2015-08-07T13:52:58Z","body":"used @purbon's seed I have the same issue\r\n```\r\nFailures:\r\n\r\n  1) LogStash::Filters::Date fill last year if december events arrive in january \"Dec 31 23:59:00\" when processed\r\n     Failure/Error: insist { subject[\"@timestamp\"].year } == 2013\r\n     Insist::Failure:\r\n       Expected 2013, but got 2014\r\n     # ./spec/filters/date_spec.rb:388:in `(root)'\r\n\r\nFinished in 1.69 seconds (files took 2.18 seconds to load)\r\n50 examples, 1 failure\r\n\r\nFailed examples:\r\n\r\nrspec ./spec/filters/date_spec.rb:385 # LogStash::Filters::Date fill last year if december events arrive in january \"Dec 31 23:59:00\" when processed\r\n\r\nRandomized with seed 28114\r\n\r\n/t/logstash-filter-date git:pr/4 ❯❯❯ ruby -v                                                                                                                                                                                                                                                                                                                            ⏎\r\njruby 1.7.20 (1.9.3p551) 2015-05-04 3086e6a on Java HotSpot(TM) 64-Bit Server VM 1.8.0_20-b26 +jit [darwin-x86_64]\r\n```"}}