# Different dashboard from multiple indexes for different project logs

**URL:** https://discuss.elastic.co/t/different-dashboard-from-multiple-indexes-for-different-project-logs/195300
**Category:** Kibana
**Created:** [August 15, 2019, 6:18am UTC](https://discuss.elastic.co/t/different-dashboard-from-multiple-indexes-for-different-project-logs/195300 "2019-08-15T06:18:24Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![DG13](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@DG13](https://discuss.elastic.co/u/DG13)
#### Post date: [August 15, 2019, 6:18am UTC](https://discuss.elastic.co/t/different-dashboard-from-multiple-indexes-for-different-project-logs/195300/1 "2019-08-15T06:18:24Z")

</div>

Hi,  
Use case : Multiple project logs file  
Kibana : Each project log files is stored as one index like project1 index is index1 , project2 index project2

I am new to ELK stack , Need advise do I need to create multiple dashboards for each project index or I can use the same dashboard and can configure the index id in dashboard through API call ?  
If anybody has faced this kind of use case and have better solution let me know .

Thanks ,  
Divya

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [August 15, 2019, 7:56am UTC](https://discuss.elastic.co/t/different-dashboard-from-multiple-indexes-for-different-project-logs/195300/2 "2019-08-15T07:56:41Z")

</div>

Hi @DG13,

It is possible to have a single dashboard with visualizations using different indices as data source as the index pattern is always tied to the individual visualization, not the dashboard, and you can place any visualization on a dashboard.

The steps are as follows:

- Go to `Management > Index patterns` and configure one index pattern per project index. And index pattern is a set of indices but it can also contain just a single one (you've probably already done this)
- Go to `Visualize` and create your visualizations . If you create a new visualization, you will be prompted to select an index pattern as data source. A best practice is to prefix the name with something like `[project1]` to make it obvious what index pattern the visualization is referring to.
- Go to `Dashboard`, create a new dashboard and add all the visualizations you want, no matter the index pattern.

However there is one pitfall: If the indices used on the same dashboard contain different fields (e.g. `index1` contains the field `fieldA` but not `fieldB` and `index2` doesn't contain `fieldA` but does contain `fieldB`), you have to be careful while applying filters to the dashboard because they will be applied to all the visualizations regardless the underlying index. This means if you filter by `fieldB` to equal `value1`, all visualizations using `index1` will stop showing data because there won't be a single document in `index1` mathcing this criteria. If your indices all feature the same fields, there won't be a problem.

---

<div class="post-metadata">

### Author: ![DG13](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@DG13](https://discuss.elastic.co/u/DG13)
#### Post date: [August 15, 2019, 10:23am UTC](https://discuss.elastic.co/t/different-dashboard-from-multiple-indexes-for-different-project-logs/195300/3 "2019-08-15T10:23:50Z")

</div>

You mean I have to create the visualization per project index that may be lead me to duplicate the visualizations . As I have 3 dashboards currently and each dashboard has 7 visualizations  
If I follow the technique you suggested I have to duplicate 3_7 visualizations and If I have 10 projects then it will 10_3\*7 .  
Correct me if my understanding is wrong

Thanks,  
Divya

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [August 15, 2019, 11:56am UTC](https://discuss.elastic.co/t/different-dashboard-from-multiple-indexes-for-different-project-logs/195300/4 "2019-08-15T11:56:41Z")

</div>

Thats correct, but if you have that many projects and you want to have identical dashboards for each of them there is a simpler way.

- Ingest the data with an additional field `project` that holds the value `project1`, `project2` and so on.
- Create an index pattern that covers all of your project indices, e.g. if your indices are called `index1`, `index2`, ..., then your index pattern should be `index*`.
- Create your visualizations once referencing the "all projects" index pattern.
- Create a single dashboard and add all visualizations
- Place a filter on the dashboard filtering down on the `project` field to a single project. Now you can switch between the different project views by changing the filter value on a single dashboard.

 ![17](https://us1.discourse-cdn.com/elastic/original/3X/1/4/14614b764d49f5e4ae495e9984359854604ad8ba.png)

This has the additional advantage of not having to change n dashboards if you want to change something on all of them. If you want to "branch out" a dashboard for a specific project and make a separate dashboard, you can also clone your dashboard and save it under a new name.

The process outlined above makes sense if you want to have different views depending on the project.

---

<div class="post-metadata">

### Author: ![DG13](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@DG13](https://discuss.elastic.co/u/DG13)
#### Post date: [August 16, 2019, 2:16am UTC](https://discuss.elastic.co/t/different-dashboard-from-multiple-indexes-for-different-project-logs/195300/5 "2019-08-16T02:16:49Z")

</div>

That's good idea but caveat here is, if the index grows in my case 10 project with daily refresh . Doesn't that affect the performance ?  
My thoughts on solution ( unsure about the feasibility of the solution has anybody ever tried it ? )

1. Create landing page having link for each project for example[Project1](http://project1)
2. Place the index id as variable in all the visualizations
3. When user clicks on the link It should pass the index id to the visualization and display that project specific data (index) to the dashboards

Is this solution possible ?  
Is there any way we can pass the index id to the visualization ?

Thanks,  
Divya

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [August 16, 2019, 7:14am UTC](https://discuss.elastic.co/t/different-dashboard-from-multiple-indexes-for-different-project-logs/195300/6 "2019-08-16T07:14:27Z")

</div>

The index pattern is always tied to the visualization, it's not possible to parameterize it without changing the saved object.

One way to do that would be to use the [Saved Objects API](https://www.elastic.co/guide/en/kibana/master/saved-objects-api.html) to programmatically copy visualizations and dashboard while changing the index pattern.

But I would try to keep it simple in the beginning - Elasticsearch is quite performant regarding these things and does a lot of optimizations under the hood. Once it becomes a problem it's still possible to craft a more sophisticated solution.

---

<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: [September 13, 2019, 7:14am UTC](https://discuss.elastic.co/t/different-dashboard-from-multiple-indexes-for-different-project-logs/195300/7 "2019-09-13T07:14:32Z")

</div>

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