Is there a way to use logstash template without specifying index name as "logstash-*" when using Elasticsearch output plugin?

I know when you output tot Elasticsearch and you specify your index name to output to as "logstash-"
then your output also contains raw fields. This is because when you use index name "logstash-
" then it uses the logstash template which has a mapping that also maps fields as .raw. How do I tell logstash to use this template, but instead of outputting my output to an index named "logstash-" then I use another index name for example
Hope this makes sense.
I know I can specify my own template and use that, but I specifically want to use the logstash-* template.


You need to copy the existing template and rename it.
Use the _templates API endpoint for that.

Right. And also change your Logstash output section to reflect your new index name. I personally don't use the default Logstash... I name my indexes after the type of data I'm storing, and have a template for each one.

That was what I was implying that I specify my own name for each index, but what I wanted to know is if I can use the logstash template without having to copy it to a file and pointing the index to the template file in my logstash template.