{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/logstash-forwarder/issues/465","labels_url":"https://api.github.com/repos/elastic/logstash-forwarder/issues/465/labels{/name}","comments_url":"https://api.github.com/repos/elastic/logstash-forwarder/issues/465/comments","events_url":"https://api.github.com/repos/elastic/logstash-forwarder/issues/465/events","html_url":"https://github.com/elastic/logstash-forwarder/pull/465","id":77834358,"number":465,"title":"DiscoverConfigs: Ignore dirs and backup files and rewrite tests.","user":{"login":"magnusbaeck","id":9032797,"avatar_url":"https://avatars.githubusercontent.com/u/9032797?v=3","gravatar_id":"","url":"https://api.github.com/users/magnusbaeck","html_url":"https://github.com/magnusbaeck","followers_url":"https://api.github.com/users/magnusbaeck/followers","following_url":"https://api.github.com/users/magnusbaeck/following{/other_user}","gists_url":"https://api.github.com/users/magnusbaeck/gists{/gist_id}","starred_url":"https://api.github.com/users/magnusbaeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magnusbaeck/subscriptions","organizations_url":"https://api.github.com/users/magnusbaeck/orgs","repos_url":"https://api.github.com/users/magnusbaeck/repos","events_url":"https://api.github.com/users/magnusbaeck/events{/privacy}","received_events_url":"https://api.github.com/users/magnusbaeck/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-18T22:42:09Z","updated_at":"2015-05-18T22:48:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/elastic/logstash-forwarder/pulls/465","html_url":"https://github.com/elastic/logstash-forwarder/pull/465","diff_url":"https://github.com/elastic/logstash-forwarder/pull/465.diff","patch_url":"https://github.com/elastic/logstash-forwarder/pull/465.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/elastic/logstash-forwarder/issues/comments/103240041","html_url":"https://github.com/elastic/logstash-forwarder/pull/465#issuecomment-103240041","issue_url":"https://api.github.com/repos/elastic/logstash-forwarder/issues/465","id":103240041,"user":{"login":"jordansissel","id":131818,"avatar_url":"https://avatars.githubusercontent.com/u/131818?v=3","gravatar_id":"","url":"https://api.github.com/users/jordansissel","html_url":"https://github.com/jordansissel","followers_url":"https://api.github.com/users/jordansissel/followers","following_url":"https://api.github.com/users/jordansissel/following{/other_user}","gists_url":"https://api.github.com/users/jordansissel/gists{/gist_id}","starred_url":"https://api.github.com/users/jordansissel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordansissel/subscriptions","organizations_url":"https://api.github.com/users/jordansissel/orgs","repos_url":"https://api.github.com/users/jordansissel/repos","events_url":"https://api.github.com/users/jordansissel/events{/privacy}","received_events_url":"https://api.github.com/users/jordansissel/received_events","type":"User","site_admin":false},"created_at":"2015-05-18T22:48:02Z","updated_at":"2015-05-18T22:48:02Z","body":"I forgot I did some research on this before: \r\nhttps://github.com/elastic/logstash/issues/2271#issuecomment-67690459\r\n\r\nI've copied the full comment for easier reading:\r\n\r\n---\r\n\r\nI like the idea, but I\"m not sold on the proposed solution. What editor uses '~' suffix for backup files? Emacs? Vim uses `.<Filename>.swp` by default, although some users configure backup files to go to an entirely different directory and wouldn't be impacted by this problem.\r\n\r\nTested on my OSX 10.10 laptop:\r\n* vim with *no* configuration loaded: `.some_file_name.swp`\r\n* emacs (default config): when I ran it, added some weird `.#<filename>` symlink pointing at 'user@hostname.pid'\r\n* emacs: after quitting, there was a file named `#<filename>#` in the current directory\r\n* atom (default config): no backup file or other state file was found in the current directory. I have an ancient version of Atom that I never use so I'm not sure if the behavior has changed in the past year.\r\n\r\nI haven't tested any other editors, but this behavior seems hardly uniform :(\r\n\r\nI'd be open to maybe having the default be more explicit in what filenames are accepted. Perhaps only files matching /[0-9A-Za-z_-]+/ would be ok? This would ignore any dot files and any weird local state files created by the editors I've tested so far.\r\n\r\nIf you use a different  editor or an editor tested above with a different behavior, please update this ticket with what backup or local state files are created by your editor so we can try to generalize a pattern here.\r\n\r\n---"}}