mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-01 14:47:38 +00:00
20 lines
496 B
Text
20 lines
496 B
Text
{% import (
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logstorage"
|
|
) %}
|
|
|
|
{% stripspace %}
|
|
|
|
// JSONRow creates JSON row from the given fields.
|
|
{% func JSONRow(columns []logstorage.BlockColumn, rowIdx int) %}
|
|
{
|
|
{% code c := &columns[0] %}
|
|
{%q= c.Name %}:{%q= c.Values[rowIdx] %}
|
|
{% code columns = columns[1:] %}
|
|
{% for colIdx := range columns %}
|
|
{% code c := &columns[colIdx] %}
|
|
,{%q= c.Name %}:{%q= c.Values[rowIdx] %}
|
|
{% endfor %}
|
|
}{% newline %}
|
|
{% endfunc %}
|
|
|
|
{% endstripspace %}
|