From 8205472226e38c2c1d7d787db5e41c928c0bd14d Mon Sep 17 00:00:00 2001 From: Carrie Roberts Date: Tue, 8 Aug 2023 20:50:29 -0600 Subject: [PATCH] configurable syslog logger protocol (#149) --- Public/Syslog-ExecutionLogger.psm1 | 2 +- Public/config.ps1 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Public/Syslog-ExecutionLogger.psm1 b/Public/Syslog-ExecutionLogger.psm1 index 3d1f801..223b609 100644 --- a/Public/Syslog-ExecutionLogger.psm1 +++ b/Public/Syslog-ExecutionLogger.psm1 @@ -26,7 +26,7 @@ function Write-ExecutionLog($startTime, $stopTime, $technique, $testNum, $testNa # send syslog message if a syslog server is defined in Public/config.ps1 if ([bool]$artConfig.syslogServer -and [bool]$artConfig.syslogPort) { $jsonMsg = $msg | ConvertTo-Json - Send-SyslogMessage -Server $artConfig.syslogServer -Port $artConfig.syslogPort -Message $jsonMsg -Severity "Informational" -Facility "daemon" + Send-SyslogMessage -Server $artConfig.syslogServer -Port $artConfig.syslogPort -Message $jsonMsg -Severity "Informational" -Facility "daemon" -Transport $artConfig.syslogProtocol } } diff --git a/Public/config.ps1 b/Public/config.ps1 index 627850c..f064fc6 100644 --- a/Public/config.ps1 +++ b/Public/config.ps1 @@ -30,6 +30,7 @@ $artConfig = [PSCustomObject]@{ # [optional] Syslog configuration, default execution logs will be sent to this server:port syslogServer = '' # set to empty string '' if you don't want to log atomic execution details to a syslog server (don't includle http(s):\\) syslogPort = 514 + syslogProtocol = 'UDP' # options are UDP, TCP, TCPwithTLS verbose = $true; # set to true for more log output