diff --git a/fragments/functions.sh b/fragments/functions.sh index cb20292..3c6b17a 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -114,7 +114,7 @@ printlog(){ # Once we finally stop getting duplicate logs output the number of times we got a duplicate. if [[ $logrepeat -gt 1 ]];then - echo "$timestamp" : "${log_priority} : Last Log repeated ${logrepeat} times" | tee -a $log_location + echo "$timestamp" : "${log_priority} : $label : Last Log repeated ${logrepeat} times" | tee -a $log_location if [[ ! -z $datadogAPI ]]; then curl -s -X POST https://http-intake.logs.datadoghq.com/v1/input -H "Content-Type: text/plain" -H "DD-API-KEY: $datadogAPI" -d "${log_priority} : $mdmURL : $APPLICATION : $VERSION : $SESSION : Last Log repeated ${logrepeat} times" > /dev/null @@ -134,9 +134,9 @@ printlog(){ if [[ ${levels[$log_priority]} -ge ${levels[$LOGGING]} ]]; then while IFS= read -r logmessage; do if [[ "$(whoami)" == "root" ]]; then - echo "$timestamp" : "${log_priority} : ${logmessage}" | tee -a $log_location + echo "$timestamp" : "${log_priority} : $label : ${logmessage}" | tee -a $log_location else - echo "$timestamp" : "${log_priority} : ${logmessage}" + echo "$timestamp" : "${log_priority} : $label : ${logmessage}" fi done <<< "$log_message" fi