dynamic templates

Added the possiblity to use dinamyc templates. For example:
    
        elasticsearch {
                            cluster => "logstash"
                            index => "%{type}-logstash-%{+YYYY.MM.dd}"
                            template => "/etc/logstash/conf.d/%{type}-template.json"
                            template_name => "%{type}"
            }
    
It will also allow to parametrize the template. For example:
    
    {
        "template": "%{type}-",
        "settings": {
          "number_of_shards"            : 5,
          "index.cache.field.type"      : "soft",
          "index.refresh_interval"      : "2s",
          "index.store.compress.stored" : true,
          "index.query.default_field"   : "@message"
        },
        .......
    }

Using conditionals like:

      if  [type] == "apache" {
                elasticsearch {
                        .........
                        template => "/etc/logstash/conf.d/apache-template.json" 
                        template_name => "apache" 
                }
      }
Requires to do a reload of logstash config. Which might not be optimal.
Maybe we could add something to check if an event has already occured, therefore it does not need to be installed