install filebeat script
This commit is contained in:
parent
2ca76f7617
commit
3d702e686f
31
Install-Filebeat.ps1
Normal file
31
Install-Filebeat.ps1
Normal file
@ -0,0 +1,31 @@
|
||||
# PowerShell Script to Install Filebeat 8.17.4 on Windows
|
||||
|
||||
# Variables
|
||||
$filebeatUrl = "https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.17.4-windows-x86_64.zip"
|
||||
$zipPath = "$env:TEMP\filebeat.zip"
|
||||
$extractPath = "C:\Program Files"
|
||||
$finalPath = "C:\Program Files\Filebeat"
|
||||
$originalDir = "$extractPath\filebeat-8.17.4-windows-x86_64"
|
||||
|
||||
Write-Host "Downloading Filebeat..." -ForegroundColor Cyan
|
||||
Invoke-WebRequest -Uri $filebeatUrl -OutFile $zipPath
|
||||
|
||||
Write-Host "Extracting Filebeat to $extractPath..." -ForegroundColor Cyan
|
||||
Expand-Archive -Path $zipPath -DestinationPath $extractPath -Force
|
||||
|
||||
Write-Host "Renaming extracted folder to 'Filebeat'..." -ForegroundColor Cyan
|
||||
Rename-Item -Path $originalDir -NewName "Filebeat"
|
||||
|
||||
# Set execution policy for the current process if needed
|
||||
$policy = Get-ExecutionPolicy -Scope Process
|
||||
if ($policy -ne 'Unrestricted') {
|
||||
Write-Host "Setting execution policy to Unrestricted for this session..." -ForegroundColor Yellow
|
||||
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process -Force
|
||||
}
|
||||
|
||||
# Install Filebeat as a Windows service
|
||||
Write-Host "Installing Filebeat service..." -ForegroundColor Cyan
|
||||
Set-Location -Path $finalPath
|
||||
.\install-service-filebeat.ps1
|
||||
|
||||
Write-Host "Filebeat installation completed!" -ForegroundColor Green
|
Loading…
x
Reference in New Issue
Block a user