mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-26 12:20:10 +01:00
21 lines
496 B
Plaintext
21 lines
496 B
Plaintext
|
{% 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 %}
|