diff --git a/kubernetes/windows/main.ps1 b/kubernetes/windows/main.ps1 index ea67d42eb..cb2cf2b44 100644 --- a/kubernetes/windows/main.ps1 +++ b/kubernetes/windows/main.ps1 @@ -766,8 +766,8 @@ function Start-Fluent-Telegraf { $windowsFluentBitDisabled = [System.Environment]::GetEnvironmentVariable("AZMON_WINDOWS_FLUENT_BIT_DISABLED", "process") $isAADMSIAuth = [System.Environment]::GetEnvironmentVariable("USING_AAD_MSI_AUTH") - # Start fluentd as a windows service only if windowsFluentBitDisabled is false or isAADMSIAuth is false or genevaLogsIntegration is true - if ($windowsFluentBitDisabled.ToLower() -ne 'false' -or $genevaLogsIntegration.ToLower() -eq "true" -or $isAADMSIAuth.ToLower() -ne "true") { + # Start fluentd as a windows service only if windowsFluentBitDisabled is true or isAADMSIAuth is false or genevaLogsIntegration is true + if ([string]::IsNullOrEmpty($windowsFluentBitDisabled) -or $windowsFluentBitDisabled.ToLower() -eq 'true' -or ( ![string]::IsNullOrEmpty($genevaLogsIntegration) -and $genevaLogsIntegration.ToLower() -eq "true") -or [string]::IsNullOrEmpty($isAADMSIAuth) -or $isAADMSIAuth.ToLower() -eq "false") { fluentd --reg-winsvc i --reg-winsvc-auto-start --winsvc-name fluentdwinaks --reg-winsvc-fluentdopt '-c C:/etc/fluent/fluent.conf -o C:/etc/fluent/fluent.log' }