The "init" option is really a nice idea to execute code at logstash startup.
This would be great to add a similar option to execute code at logstash shutdown.
For example "stop" or "shutdown".
In the idea, if defined, the code would be executed in the logstash 2.0 plugin method "stop()".