Not able to use templates with Log Stash

I am trying to configure the number of shards in Logstash using templates, this is my template:

{
    "template": "logstash-*",
    "settings": {
        "number_of_shards": 32,
        "number_of_replicas" : 0
    }
}

This is my yaml file:

        output {
          elasticsearch {
            hosts => [ "" ]
            user => ""
            password => ""
            ssl_verification_mode => "none"
            index => "logstash-2"
            manage_template => true
            template => "/mnt/logstash/logstash.json"
            template_name => "logstash"
            template_overwrite => false
          }
        }

I am facing this error:

[index_template] template doesn't support values of type: VALUE_STRING\"}],\"type\":\"x_content_parse_exception\",\"reason\":\"[1:13] [index_template] template doesn't support values of type: VALUE_STRING\"},\"status\":400}"}```

Which logstash version are you using? You didn't say.

Also, the template you shared is not a valid template and it is also not the same file being used based in your error.

This is an example of a valid template.

Thank you very much for the reply, the template format was wrong and I am now able to use it correctly