Hi,
Please help I am trying to execute this PowerShell script in my windows system to get Metricbeat data to elastic but it does not work as intended , The script runs properly by downloading the metric beat file to c:\user\programfile & the service runs & also shows in windows services, but there is no index created when I check stack management -> Index management. I have attached the screenshot of metricbeat that has been downloaded via the script & the yml file it has inside the folder
$Tag = Read-Host "Please enter the tag name for server"
$source = 'https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-7.14.1-windows-x86_64.zip'
# Destination to save the file
$destination = 'C:\Program Files\metricbeat-7.14.1-windows-x86_64.zip'
#Download the file
Invoke-WebRequest -Uri $source -OutFile $destination
expand-archive -path 'C:\Program Files\metricbeat-7.14.1-windows-x86_64.zip' -destinationpath 'C:\Program Files'
Rename-Item -Path "C:\Program Files\metricbeat-7.14.1-windows-x86_64" -NewName "Metricbeat"
cd 'C:\Program Files\Metricbeat'
PowerShell.exe -ExecutionPolicy UnRestricted -File .\install-service-metricbeat.ps1
Add-Content 'C:\Program Files\Metricbeat\metricbeat.yml' "`ncloud.id: `"https://cloud_location.com:443`"; "
Add-Content 'C:\Program Files\Metricbeat\metricbeat.yml' "`ncloud.auth: `"abc-metricbeat:password`" "
Add-Content 'C:\Program Files\Metricbeat\metricbeat.yml' "`nsetup.ilm.enabled: false `noutput.elasticsearch.index: `"abc-server-%{+YYYY.MM}`" `nsetup.template.overwrite: true `nsetup.template.enabled: true `nsetup.template.name: `"abc-server`" `nsetup.template.pattern: `"abc-server-*`" "
Add-Content 'C:\Program Files\Metricbeat\metricbeat.yml' "`ntags: [$Tag]"
Add-Content 'C:\Program Files\Metricbeat\metricbeat.yml' "`nspace.id: abc-space"
Start-Service metricbeat
Kindly help & guide me what is wrong & if there is any change required & if any change is required please modify & share I am new to this so please
Thanks,