From 18d824a0b2f1b4b892dc4f1113721bc087ed825b Mon Sep 17 00:00:00 2001 From: Jonathan Rockway <2367+jrockway@users.noreply.github.com> Date: Sat, 18 Jun 2022 19:03:50 -0400 Subject: [PATCH] parse: auto-guess Pachyderm worker log schema --- pkg/parse/parse.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/parse/parse.go b/pkg/parse/parse.go index a7f8882..d25e54d 100644 --- a/pkg/parse/parse.go +++ b/pkg/parse/parse.go @@ -428,6 +428,14 @@ func (s *InputSchema) guessSchema(l *line) { s.UpgradeKeys = append(s.UpgradeKeys, "data") return } + if has("ts") && has("message") && has("workerId") && has("pipelineName") { + // Pachyderm worker logs. + s.TimeKey = "ts" + s.TimeFormat = DefaultTimeParser // RFC3339Nano + s.NoLevelKey = true + s.MessageKey = "message" + return + } } // ReadLine parses a log line into the provided line object.