how-to:fluent_bit
Содержание
Fluent Bit
Установка
Windows
https://docs.fluentbit.io/manual/installation/windows
if (Get-Service | Select-Object Name | Select-String FluentBit){Stop-Service -Name "FluentBit"} $FLUENTBIT_VERSION="2.0.9" function fluentbit{ $URL="https://releases.fluentbit.io/$(echo $FLUENTBIT_VERSION | %{$_ -replace '(\d+)(.\d+)?(.\d+)','$1$2'})/fluent-bit-$FLUENTBIT_VERSION-win64.exe" $Filename = [System.IO.Path]::GetFileName($URL) if (!(Test-Path "$env:Temp\$Filename")){ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $dl = New-Object net.webclient $dl.Downloadfile($URL, "$env:Temp\$Filename") } ."$env:Temp\$Filename" /S } fluentbit if (Get-Service | Select-Object Name | Select-String FluentBit){Start-Service -Name "FluentBit"}
Создать службу:
New-Service -Name "FluentBit" -BinaryPathName '"C:\Program Files\fluent-bit\bin\fluent-bit.exe" -c "C:\Program Files\fluent-bit\conf\fluentbit.conf"' -StartupType Automatic
или
sc create FluentBit binpath= "\"C:\Program Files\fluent-bit\fluent-bit.exe\" -c \"C:\Program Files\fluent-bit\conf\fluentbit.conf\""
Удалить службу:
(Get-WmiObject win32_service -Filter "name='FluentBit'").delete()
или
sc delete FluentBit
Запустить службу:
Start-Service FluentBit
или
sc start FluentBit
Примеры
Отправить json логи в loki (с назначением меток из имени директории):
Ссылки
how-to/fluent_bit.txt · Последнее изменение: — 127.0.0.1
