Skip to content

Commit

Permalink
Merge pull request #69 from 128technology/release-128tech-1.22.6-temp
Browse files Browse the repository at this point in the history
Put 1.22.6-4 changes into 1.22 mainline release branch
  • Loading branch information
BenMatase committed Dec 18, 2023
2 parents 17fc1c6 + 87d5e89 commit e40712f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/outputs/syslog/syslog_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ import (
"os"
"strconv"
"strings"
"sync"
"time"

"github.com/influxdata/go-syslog/v3/rfc5424"

"github.com/influxdata/telegraf"
)

// this is needed until https://github.com/influxdata/go-syslog/pull/51 is released
var translationMutex sync.Mutex

type SyslogMapper struct {
DefaultSdid string
DefaultSeverityCode uint8
Expand Down Expand Up @@ -57,6 +61,9 @@ func (sm *SyslogMapper) mapStructuredDataItem(key string, value string, msg *rfc
return
}

translationMutex.Lock()
defer translationMutex.Unlock()

value = escapeInvalidCharacters(value)

isExplicitSdid := false
Expand Down

0 comments on commit e40712f

Please sign in to comment.