Skip to content

Commit 53102e9

Browse files
authored
Add support for logs format (#38)
1 parent c316d75 commit 53102e9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

query.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ const (
2121
FormatOptionTimeSeries FormatQueryOption = iota
2222
// FormatOptionTable formats the query results as a table using "LongToWide"
2323
FormatOptionTable
24+
// FormatOptionLogs sets the preferred visualization to logs
25+
FormatOptionLogs
2426
)
2527

2628
// Query is the model that represents the query that users submit from the panel / queryeditor.
@@ -149,6 +151,11 @@ func getFrames(rows *sql.Rows, limit int64, converters []sqlutil.Converter, fill
149151
return data.Frames{frame}, nil
150152
}
151153

154+
if query.Format == FormatOptionLogs {
155+
frame.Meta.PreferredVisualization = data.VisTypeLogs
156+
return data.Frames{frame}, nil
157+
}
158+
152159
count, err := frame.RowLen()
153160

154161
if err != nil {

0 commit comments

Comments
 (0)