# How can I create multi-index by ---track-params?

**URL:** <https://discuss.elastic.co/t/how-can-i-create-multi-index-by-track-params/148092>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [September 11, 2018, 8:49am UTC](https://discuss.elastic.co/t/how-can-i-create-multi-index-by-track-params/148092 "2018-09-11T08:49:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Todd](https://avatars.discourse-cdn.com/v4/letter/t/fbc32d/32.png) [@Todd](https://discuss.elastic.co/u/Todd)\
**Post date:** [September 11, 2018, 8:49am UTC](https://discuss.elastic.co/t/how-can-i-create-multi-index-by-track-params/148092/1 "2018-09-11T08:49:10Z")

</div>

Now, the configuration file `track.json` is:

```auto
{% set index_count = 3 %}
{
  "version": 2,
  "description": "max throughput with {{index_count}} index",
  "indices": [
    {% set comma = joiner() %}
    {% for item in range(index_count) %}
    {{ comma() }}
    {
      "name": "billions-jssz.benchmark.scene1-{{item}}",
      "body": "settings/mapping.json",
      "types": ["logs"]
    }
    {% endfor %}
  ],
...

```

when I want to change the number of indices,I have to rewrite the `index_count` at line 1. But I just want to change it by `--track-params`, just like: `--track-params=params.json`:

```auto
{
    "index_count": 5
}

```

I am not good at Jinja, so how should I write the `track.json`,please?

---

<div class="post-metadata">

**Author:** ![dliappis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dliappis/32/56174_2.png) [@dliappis](https://discuss.elastic.co/u/dliappis)\
**Post date:** [September 11, 2018, 10:50am UTC](https://discuss.elastic.co/t/how-can-i-create-multi-index-by-track-params/148092/2 "2018-09-11T10:50:03Z")

</div>

Hi,

You can directly use the value specified for `index_count` in your `params.json`, but of course, right now you track is hard coding it to the value `3`.

If you still want to keep a default value you could do something like:

```auto
{% if index_count is not defined %}
{% set index_count = 3 %}
{% endif %}

```

this should allow the use of custom values for `index_count` in your `params.json`.

See also: [http://jinja.pocoo.org/docs/2.10/templates/#defined](http://jinja.pocoo.org/docs/2.10/templates/#defined)

Rgs,  
Dimitris

---

<div class="post-metadata">

**Author:** ![Todd](https://avatars.discourse-cdn.com/v4/letter/t/fbc32d/32.png) [@Todd](https://discuss.elastic.co/u/Todd)\
**Post date:** [September 12, 2018, 2:42am UTC](https://discuss.elastic.co/t/how-can-i-create-multi-index-by-track-params/148092/3 "2018-09-12T02:42:41Z")

</div>

I have tryed, it works.  
Thanks a lot !😀

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 10, 2018, 2:42am UTC](https://discuss.elastic.co/t/how-can-i-create-multi-index-by-track-params/148092/4 "2018-10-10T02:42:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
