I am getting an 403

Hello,
I am getting below error can someone pls guide

Failed to install template {:message=>"Got response code '403' contacting Elasticsearch at URL <es_host>/_index_template/ecs-logstash'", :exception=>LogStash::Outputs::Elasticsearch::HttpClient::Pool::BadResponseCodeError, :backtrace=>["D:/logstash-8.4.1/vendor/bundle/jruby/2.6.0/gems/logstash-output-elasticsearch-11.6.0-java/lib/logstash/outputs/elasticsearch/http_client/manticore_adapter.rb:84:in perform_request'", "D:/logstash-8.4.1/vendor/bundle/jruby/2.6.0/gems/logstash-output-elasticsearch-11.6.0-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:324:in perform_request_to_url'", "D:/logstash-8.4.1/vendor/bundle/jruby/2.6.0/gems/logstash-output-elasticsearch-11.6.0-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:311:in block in perform_request'", "D:/logstash-8.4.1/vendor/bundle/jruby/2.6.0/gems/logstash-output-elasticsearch-11.6.0-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:398:in with_connection'", "D:/logstash-8.4.1/vendor/bundle/jruby/2.6.0/gems/logstash-output-elasticsearch-11.6.0-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:310:in perform_request'", "D:/logstash-8.4.1/vendor/bundle/jruby/2.6.0/gems/logstash-output-elasticsearch-11.6.0-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:318:in block in Pool'", "D:/logstash-8.4.1/vendor/bundle/jruby/2.6.0/gems/logstash-output-elasticsearch-11.6.0-java/lib/logstash/outputs/elasticsearch/http_client.rb:408:in template_put'", "D:/logstash-8.4.1/vendor/bundle/jruby/2.6.0/gems/logstash-output-elasticsearch-11.6.0-java/lib/logstash/outputs/elasticsearch/http_client.rb:85:in template_install'", "D:/logstash-8.4.1/vendor/bundle/jruby/2.6.0/gems/logstash-output-elasticsearch-11.6.0-java/lib/logstash/outputs/elasticsearch/template_manager.rb:29:in install'", "D:/logstash-8.4.1/vendor/bundle/jruby/2.6.0/gems/logstash-output-elasticsearch-11.6.0-java/lib/logstash/outputs/elasticsearch/template_manager.rb:17:in install_template'", "D:/logstash-8.4.1/vendor/bundle/jruby/2.6.0/gems/logstash-output-elasticsearch-11.6.0-java/lib/logstash/outputs/elasticsearch.rb:494:in install_template'", "D:/logstash-8.4.1/vendor/bundle/jruby/2.6.0/gems/logstash-output-elasticsearch-11.6.0-java/lib/logstash/outputs/elasticsearch.rb:318:in finish_register'", "D:/logstash-8.4.1/vendor/bundle/jruby/2.6.0/gems/logstash-output-elasticsearch-11.6.0-java/lib/logstash/outputs/elasticsearch.rb:283:in block in register'", "D:/logstash-8.4.1/vendor/bundle/jruby/2.6.0/gems/logstash-output-elasticsearch-11.6.0-java/lib/logstash/plugin_mixins/elasticsearch/common.rb:154:in block in after_successful_connection'"]}

{"error":{"root_cause":[{"type":"resource_not_found_exception","reason":"index template matching [ecs-logstash'] not found"}],"type":"resource_not_found_exception","reason":"index template matching [ecs-logstash'] not found"},"status":404}

THe Error

You've posted two different errors (403 and 404) which one are you getting?