diff --git a/internal/config/config.go b/internal/config/config.go index 9408d9efd..56c07fee3 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -916,6 +916,22 @@ func buildParser(name string, tbl *ast.Table) (parsers.Parser, error) { } } + if node, ok := tbl.Fields["timestamp_selector"]; ok { + if kv, ok := node.(*ast.KeyValue); ok { + if str, ok := kv.Value.(*ast.String); ok { + c.TimestampSelector = str.Value + } + } + } + + if node, ok := tbl.Fields["timestamp_formatter"]; ok { + if kv, ok := node.(*ast.KeyValue); ok { + if str, ok := kv.Value.(*ast.String); ok { + c.TimestampFormatter = str.Value + } + } + } + c.MetricName = name delete(tbl.Fields, "data_format") @@ -923,6 +939,8 @@ func buildParser(name string, tbl *ast.Table) (parsers.Parser, error) { delete(tbl.Fields, "templates") delete(tbl.Fields, "tag_keys") delete(tbl.Fields, "data_type") + delete(tbl.Fields, "timestamp_selector") + delete(tbl.Fields, "timestamp_formatter") return parsers.NewParser(c) }