Skip to content

Instantly share code, notes, and snippets.

@bschaeffer
Created July 8, 2020 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bschaeffer/5e3555ef3b1fee0dc36e887f64f48119 to your computer and use it in GitHub Desktop.
Save bschaeffer/5e3555ef3b1fee0dc36e887f64f48119 to your computer and use it in GitHub Desktop.
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