Created
July 8, 2020 12:56
-
-
Save bschaeffer/5e3555ef3b1fee0dc36e887f64f48119 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type logEntry struct { | |
Timestamp time.Time `json:"timestamp"` | |
Message string `json:"message"` | |
App string `json:"app"` | |
Pod string `json:"pod"` | |
} | |
func buildLogEntry(e publisher.Event) logEntry { | |
msg, _ := e.Content.GetValue("message") | |
app, _ := e.Content.GetValue("kubernetes.label.app") | |
pod, _ := e.Content.GetValue("kubernetes.pod.name") | |
return logEntry{ | |
Timestamp: e.Content.Timestamp, | |
Message: msg, | |
App: app, | |
Pod: pod, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment