Previously, I have used filebeat 5.4.0 and able to set the filebeat input path dynamically by modifying the install-service-filebeat script like
#start filebeat service
if ($filebeat_input_path.length -gt 0)
{
# create new service
New-Service -name filebeat `
-displayName filebeat `
-binaryPathName "`"$workdir\filebeat.exe`" -c `"$workdir\filebeat.yml`" -E `"filebeat.prospectors.0.paths=[`"$filebeat_input_path`"]`" -path.home `"$workdir`" -path.data `"$workdir`""
# start service
Start-Service -Name "filebeat"
}
and the above script was running fine and the logs are harvested and fed into elasticsearch.
But at present, we are planning for an upgradation of ELK stack, so we thought of using filebeat 6.5.2 version and hence the modified the installation script like
#start filebeat service
if ($filebeat_input_path.length -gt 0)
{
# create new service
New-Service -name filebeat `
-displayName filebeat `
-binaryPathName "`"$workdir\filebeat.exe`" -c `"$workdir\filebeat.yml`" -E `"filebeat.inputs.0.paths=[`"$filebeat_input_path`"]`" -path.home `"$workdir`" -path.data `"$workdir`""
# start service
Start-Service -Name "filebeat"
}
but the change is of no use. Can you guide me in solving this.