# Passing index name/index pattern dynamically in Kibana 5

**URL:** <https://discuss.elastic.co/t/passing-index-name-index-pattern-dynamically-in-kibana-5/108508>\
**Category:** Kibana\
**Created:** [November 21, 2017, 5:13am UTC](https://discuss.elastic.co/t/passing-index-name-index-pattern-dynamically-in-kibana-5/108508 "2017-11-21T05:13:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![piku](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@piku](https://discuss.elastic.co/u/piku)\
**Post date:** [November 21, 2017, 5:13am UTC](https://discuss.elastic.co/t/passing-index-name-index-pattern-dynamically-in-kibana-5/108508/1 "2017-11-21T05:13:32Z")

</div>

Suppose I have created a chart in Kibana 5 and it uses a specific index as as its index pattern (say X).  
I want see the same effect on another index using the already created chart.

Can I make the chart configurable so that the index pattern could be passed as a parameter and based on my passed value of the index pattern (X or Y or Z ) the chart display would vary ?

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [November 21, 2017, 5:25pm UTC](https://discuss.elastic.co/t/passing-index-name-index-pattern-dynamically-in-kibana-5/108508/2 "2017-11-21T17:25:09Z")

</div>

If I had 2 indices that are named with a different pattern but are the same schema, I think what would do to meet the requirement you're looking for is:

1. Make an alias that is associated with both indices (See [https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html))
2. Make an index pattern in Kibana that uses the alias
3. To make the chart only show data for index X, use a filter for `_index:X`
4. To switch the chart to a different index, change the filter to `_index:Y` or `_index:Z`

This will only work if all the indices have the same schema. If they really have the same schema though, why not just put them all in the same index and add a custom type field that you can filter on?

---

<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:** [December 19, 2017, 5:25pm UTC](https://discuss.elastic.co/t/passing-index-name-index-pattern-dynamically-in-kibana-5/108508/3 "2017-12-19T17:25:21Z")

</div>

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