Sorry i wasn't clear in my previous comments.. the logstash parts can be on top of the file. the require's specific for the plugin should be in the register part.