mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
21 lines
496 B
Text
21 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 %}
|