{"action":"created","issue":{"url":"https://api.github.com/repos/jordansissel/ruby-filewatch/issues/16","repository_url":"https://api.github.com/repos/jordansissel/ruby-filewatch","labels_url":"https://api.github.com/repos/jordansissel/ruby-filewatch/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/jordansissel/ruby-filewatch/issues/16/comments","events_url":"https://api.github.com/repos/jordansissel/ruby-filewatch/issues/16/events","html_url":"https://github.com/jordansissel/ruby-filewatch/pull/16","id":12780657,"number":16,"title":"Add Env Var setting to close the file after reading. This will fix issues in Windows","user":{"login":"thesolution","id":1847089,"avatar_url":"https://avatars.githubusercontent.com/u/1847089?v=3","gravatar_id":"","url":"https://api.github.com/users/thesolution","html_url":"https://github.com/thesolution","followers_url":"https://api.github.com/users/thesolution/followers","following_url":"https://api.github.com/users/thesolution/following{/other_user}","gists_url":"https://api.github.com/users/thesolution/gists{/gist_id}","starred_url":"https://api.github.com/users/thesolution/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thesolution/subscriptions","organizations_url":"https://api.github.com/users/thesolution/orgs","repos_url":"https://api.github.com/users/thesolution/repos","events_url":"https://api.github.com/users/thesolution/events{/privacy}","received_events_url":"https://api.github.com/users/thesolution/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2013-04-04T00:19:59Z","updated_at":"2016-09-30T18:38:18Z","closed_at":"2015-02-16T17:54:13Z","pull_request":{"url":"https://api.github.com/repos/jordansissel/ruby-filewatch/pulls/16","html_url":"https://github.com/jordansissel/ruby-filewatch/pull/16","diff_url":"https://github.com/jordansissel/ruby-filewatch/pull/16.diff","patch_url":"https://github.com/jordansissel/ruby-filewatch/pull/16.patch"},"body":"This commit will fix two issues in Windows when using tail.\r\n1. If the program writing logs does not set ShareMode flags, the open operation on the file fails and messages are not written.\r\n2. Tail is locking the log file(s) so they cannot be deleted.\r\n\r\nIn Windows if the program writing logs opens the file with dwShareMode=0\r\nthe log writing operation fails. Closing the file after reading allows\r\nthe writing process to obtain the exclusive lock.  This also allows for\r\nrolling logs to work in windows since the file lock is released after\r\neach read operation.\r\nUsage:\r\nWindows:  set CloseAfterRead=true\r\nRuby: ENV[\"CloseAfterRead\"] = \"true\"\r\nMac/Linux:  Export CloseAfterRead=true"},"comment":{"url":"https://api.github.com/repos/jordansissel/ruby-filewatch/issues/comments/250820585","html_url":"https://github.com/jordansissel/ruby-filewatch/pull/16#issuecomment-250820585","issue_url":"https://api.github.com/repos/jordansissel/ruby-filewatch/issues/16","id":250820585,"user":{"login":"sujoy123","id":6484482,"avatar_url":"https://avatars.githubusercontent.com/u/6484482?v=3","gravatar_id":"","url":"https://api.github.com/users/sujoy123","html_url":"https://github.com/sujoy123","followers_url":"https://api.github.com/users/sujoy123/followers","following_url":"https://api.github.com/users/sujoy123/following{/other_user}","gists_url":"https://api.github.com/users/sujoy123/gists{/gist_id}","starred_url":"https://api.github.com/users/sujoy123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sujoy123/subscriptions","organizations_url":"https://api.github.com/users/sujoy123/orgs","repos_url":"https://api.github.com/users/sujoy123/repos","events_url":"https://api.github.com/users/sujoy123/events{/privacy}","received_events_url":"https://api.github.com/users/sujoy123/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T18:38:18Z","updated_at":"2016-09-30T18:38:18Z","body":"I still get File locking in Windows 2012 R2, using LogStash 1.5. Logstash 2.2 and even Filebeat has similar problem. Can someone help me understand which version should I use in Windows 2012 R2?"}}
{"actor":{"display_login":"sujoy123"}}