{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/logstash/issues/3920","labels_url":"https://api.github.com/repos/elastic/logstash/issues/3920/labels{/name}","comments_url":"https://api.github.com/repos/elastic/logstash/issues/3920/comments","events_url":"https://api.github.com/repos/elastic/logstash/issues/3920/events","html_url":"https://github.com/elastic/logstash/issues/3920","id":106435910,"number":3920,"title":"Configuration File Ordering Does Matter for some reason","user":{"login":"ayashjorden","id":4204371,"avatar_url":"https://avatars.githubusercontent.com/u/4204371?v=3","gravatar_id":"","url":"https://api.github.com/users/ayashjorden","html_url":"https://github.com/ayashjorden","followers_url":"https://api.github.com/users/ayashjorden/followers","following_url":"https://api.github.com/users/ayashjorden/following{/other_user}","gists_url":"https://api.github.com/users/ayashjorden/gists{/gist_id}","starred_url":"https://api.github.com/users/ayashjorden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayashjorden/subscriptions","organizations_url":"https://api.github.com/users/ayashjorden/orgs","repos_url":"https://api.github.com/users/ayashjorden/repos","events_url":"https://api.github.com/users/ayashjorden/events{/privacy}","received_events_url":"https://api.github.com/users/ayashjorden/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-14T21:55:41Z","updated_at":"2015-09-15T03:37:25Z","closed_at":null,"body":"Hi all,\r\nThis issue is the result of [this](https://discuss.elastic.co/t/logstash-configuration-file-ordering-does-matter/28840) discussion. Per @magnusbaeck [suggestion](https://discuss.elastic.co/t/logstash-configuration-file-ordering-does-matter/28840/6), I'm opening this issue so we all can benefit and understand Logstash better.\r\nI'm running logstash with a couple of ```-f``` switches and for some unknown reason, the order of the files does matter:\r\n```\r\ninput-filter-output:\r\n~/util/logstash-1.5.4/bin/logstash -f ./conf.d/input-50-email-sending.conf -f ./conf.d/filter-50-email-sending.conf -f ./conf.d/output-50-receiver.conf\r\nLogstash startup completed\r\nLogstash shutdown completed\r\n \r\ninput-output-filter:\r\n~/util/logstash-1.5.4/bin/logstash -f ./conf.d/input-50-email-sending.conf -f ./conf.d/output-50-receiver.conf -f ./conf.d/filter-50-email-sending.conf\r\nLogstash startup completed\r\nLogstash shutdown completed\r\n \r\nfilter-output-input:\r\n~/util/logstash-1.5.4/bin/logstash -f ./conf.d/filter-50-email-sending.conf -f ./conf.d/output-50-receiver.conf -f ./conf.d/input-50-email-sending.conf\r\nLogstash startup completed\r\n#gave is some time to run...\r\n^CSIGINT received. Shutting down the pipeline. {:level=>:warn}\r\nLogstash shutdown completed\r\n```\r\nWith --debug, I found the following:\r\n```\r\ninput-filter-output:\r\nPlugin not defined in namespace, checking for plugin file {:type=>\"output\", :name=>\"http\", :path=>\"logstash/outputs/http\", :level=>:debug, :file=>\"logstash/plugin.rb\", :line=>\"133\", :method=>\"lookup\"}\r\nPlugin not defined in namespace, checking for plugin file {:type=>\"codec\", :name=>\"plain\", :path=>\"logstash/codecs/plain\", :level=>:debug, :file=>\"logstash/plugin.rb\", :line=>\"133\", :method=>\"lookup\"}\r\n\r\ninput-output-filter:\r\nPlugin not defined in namespace, checking for plugin file {:type=>\"filter\", :name=>\"csv\", :path=>\"logstash/filters/csv\", :level=>:debug, :file=>\"logstash/plugin.rb\", :line=>\"133\", :method=>\"lookup\"}\r\n\r\nfilter-output-input: Logstash starts and stays up:\r\nPlugin not defined in namespace, checking for plugin file {:type=>\"input\", :name=>\"file\", :path=>\"logstash/inputs/file\", :level=>:debug, :file=>\"logstash/plugin.rb\", :line=>\"133\", :method=>\"lookup\"}\r\nPlugin not defined in namespace, checking for plugin file {:type=>\"codec\", :name=>\"plain\", :path=>\"logstash/codecs/plain\", :level=>:debug, :file=>\"logstash/plugin.rb\", :line=>\"133\", :method=>\"lookup\"}\r\n```\r\nI didn't expect seeing errors in the 3rd bullet (filter-output-input), but Logstash stays up.\r\n\r\nIf the full log is needed, I can pastebin it, but it will take me some time to sanitize it.\r\n\r\nFWIW, My config files are standardised as follows:\r\n```\r\nfilter-[ORDERING_NUMBER]-[DESC].conf => filter-50-CDN.conf\r\ninput-[ORDERING_NUMBER]-[DESC].conf => input-50-sockets.conf\r\noutput-[ORDERING_NUMBER]-[DESC].conf => output-50-http.conf\r\n```\r\nAnother interesting thing is that if I start Logstash with \"bin/logstash - /etc/logstash/conf.d\" (passing a directory containing my configuration) its working.\r\n\r\nWhat is different between specifying specific files in certain order and specifying a directory containing the configuration?\r\n\r\nCan someone explain this behaviour ?\r\n\r\nThanks,\r\nYarden\r\n"},"comment":{"url":"https://api.github.com/repos/elastic/logstash/issues/comments/140270380","html_url":"https://github.com/elastic/logstash/issues/3920#issuecomment-140270380","issue_url":"https://api.github.com/repos/elastic/logstash/issues/3920","id":140270380,"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},"created_at":"2015-09-15T03:37:25Z","updated_at":"2015-09-15T03:37:25Z","body":"> The `-f` flag only supports a single path, specifying multiple `-f` flags is probably undefined behavior.\r\n\r\nOh. That would certainly explain things. Not bailing out on multiple `-f` occurrences would clearly be a bug, but instead of adding another error case we should support multiple options."}}