{% set db = db|default({}) -%} {% macro calc_col(index) -%} {% if index is divisibleby 2 %} 7 {% else %} 1 {% endif %} {%- endmacro %} {% macro calc_row(index) -%} {% set num = (index - 1)//2 %} {{1 + num * 3}} {%- endmacro %} { "description": "Kibana dashboard for {{db.query}}", "hits": 0, "kibanaSavedObjectMeta": { "searchSourceJSON": { "filter": [ { "query": { "query_string": { "analyze_wildcard": true, "query": "*" } } } ] } }, "metadata": { "label": "{{db.query.case_name}} {{db.query.metric}}", "test_family": "{{db.test_family}}" }, "optionsJSON": { "darkTheme": false }, "panelsJSON": [ {% for id in db.ids %} { "col": {{calc_col(loop.index)}}, "id": "{{id}}", "panelIndex": {{loop.index}}, "row": {{calc_row(loop.index)}}, "size_x": 6, "size_y": 3, "type": "visualization" } {% if not loop.last %} , {% endif %} {% endfor %} ], "scenario": 1, "timeRestore": false, "title": "{{db.query.project_name}} {{db.query.case_name}} {{db.query.installer}} {{db.query.metric}} {{db.query.pod}}", "uiStateJSON": {} }