File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ package collectors
55
66import (
77 "bufio"
8+ "os"
89 "os/exec"
910 "path/filepath"
1011
@@ -29,6 +30,11 @@ func getCollectorsInstances() []Collector {
2930func (d Darwin ) SendLogs () {
3031 path := utils .GetMyPath ()
3132 collectorPath := filepath .Join (path , "utmstack-collector-mac" )
33+ host , err := os .Hostname ()
34+ if err != nil {
35+ utils .Logger .ErrorF ("error getting hostname: %v" , err )
36+ host = "unknown"
37+ }
3238
3339 cmd := exec .Command (collectorPath )
3440
@@ -62,9 +68,11 @@ func (d Darwin) SendLogs() {
6268 continue
6369 }
6470
71+ messageWithHost := config .GetMessageFormated (host , validatedLog )
72+
6573 logservice .LogQueue <- logservice.LogPipe {
6674 Src : string (config .DataTypeMacOs ),
67- Logs : []string {validatedLog },
75+ Logs : []string {messageWithHost },
6876 }
6977 }
7078
You can’t perform that action at this time.
0 commit comments