feat(service_monitor): add more information to parsing of transfer-job-manager logs
This commit is contained in:
parent
92b5d98465
commit
2cf0699ad4
2 changed files with 37 additions and 1 deletions
|
|
@ -302,6 +302,42 @@ func parseTJMService(entry LogEntry) LogEntry {
|
|||
newEntry.Fields["message_time"] = timestampTime
|
||||
newEntry.Fields["message"] = strings.Join(info, " ")
|
||||
|
||||
if info != nil {
|
||||
tmpInfo := strings.ReplaceAll(strings.Join(info, " "), "[ ]", "[]")
|
||||
tmpSplit := strings.Fields(tmpInfo)
|
||||
var transferDirection string
|
||||
var logMessage string
|
||||
username := tmpSplit[2]
|
||||
correlationID := tmpSplit[1]
|
||||
threadID := tmpSplit[3]
|
||||
javaClass := tmpSplit[4]
|
||||
if len(tmpSplit) > 6 && strings.Contains(tmpSplit[6], "-out") {
|
||||
transferDirection = "outgoing"
|
||||
logMessage = strings.Join(tmpSplit[7:], " ")
|
||||
} else if len(tmpSplit) > 6 && strings.Contains(tmpSplit[6], "-in") {
|
||||
transferDirection = "incoming"
|
||||
logMessage = strings.Join(tmpSplit[7:], " ")
|
||||
} else {
|
||||
logMessage = strings.Join(tmpSplit[6:], " ")
|
||||
}
|
||||
if username != "" && username != "[]" {
|
||||
newEntry.Fields["username"] = username
|
||||
}
|
||||
if correlationID != "" {
|
||||
newEntry.Fields["correlation_id"] = correlationID
|
||||
}
|
||||
if threadID != "" {
|
||||
newEntry.Fields["thread_id"] = threadID
|
||||
}
|
||||
if javaClass != "" {
|
||||
newEntry.Fields["java_class"] = javaClass
|
||||
}
|
||||
if transferDirection != "" {
|
||||
newEntry.Fields["transfer_direction"] = transferDirection
|
||||
}
|
||||
newEntry.Fields["log_message"] = logMessage
|
||||
}
|
||||
|
||||
return newEntry
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue