Custom Index error

I am currently using Elastic Search and Kibana versions 8.11 along with Filebeat 8.11.2 on windows system.
I have been able to send data to elastic through filebeat with the default filebeat* index. I wanted my filebeat data to be stored into different indices for easier access and rule creation.
I've followed the steps in Configure Elasticsearch index template loading | Filebeat Reference [8.11] | Elastic to generate custom index but am failing to do so. I have added

setup.ilm.enabled: false "mycustomindex"
setup.template.pattern: "mycustomindex-*"

index: "mycustomindex"

But this seems to throw an error, and fails to run Start-Service Filebeat on power shell.
Will be grateful for any input! Thank you!

Hi @uhxqc, Could you please share the Error ?? You can check troubleshoot steps.

Thank you @ashishtiwari1993, I will check the Troubleshoot, but is my details in the Filebeat.yml file correct, or any other changes have to be made to add a custom index from Filebeat?

Looks good. Same you can test with the below command:

./filebeat test config