# Help/advices on Elasticsearch implementation

**URL:** <https://discuss.elastic.co/t/help-advices-on-elasticsearch-implementation/147695>\
**Category:** Elasticsearch\
**Created:** [September 7, 2018, 10:21am UTC](https://discuss.elastic.co/t/help-advices-on-elasticsearch-implementation/147695 "2018-09-07T10:21:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ea1987](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ea1987/32/51356_2.png) [@ea1987](https://discuss.elastic.co/u/ea1987)\
**Post date:** [September 7, 2018, 10:21am UTC](https://discuss.elastic.co/t/help-advices-on-elasticsearch-implementation/147695/1 "2018-09-07T10:21:57Z")

</div>

Hi guys,  
I'm wondering if you have some suggestions about the best way to implement the following scenario.

1 Main Business Company  
70 Small Business Companies holded by the main one

Documents to be stored in Elasticsearch: invoices  
NB: invoices are created by different billing systems grouped in logical way. For example:

BILLING SYSTEM 1 (invoices for financial services):

- small b company 1
- small b company 2
- small b company 3

BILLING SYSTEM 2 (invoices for ecommerce):

- small b company 4
- small b company 5
- small b company 6

Here is my implementation:

Elasticsearch: I will keep 70 monthly indices (using aliases, one per small b company) in order to provide data segregation. I think this will be good also by maintenance side.

Kibana (here comes the problem): I would like to maintain the same segregation. So: user of small b company 4 will be able to view informations and dashboards only of those specific related indices.

QUESTION: is there a way to implement this kind of limitation on dashboards visualizations? I know that this thing can be implemented by running 70 different Kibana instances, one per small b company with its specific .kibana index, but of course I would prefer not to do that.

Any advice will be extremely appreciated! Thank you guys!

Andrea

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 7, 2018, 1:53pm UTC](https://discuss.elastic.co/t/help-advices-on-elasticsearch-implementation/147695/2 "2018-09-07T13:53:15Z")

</div>

This does not sound like a lot of data, so having monthly indices per client is probably overkill. This is exactly the type of problem X-PAck security addresses. You can create a shared monthly index and then use [document-level security](https://www.elastic.co/guide/en/elastic-stack-overview/current/document-level-security.html) to tie subsets of documents to roles based on parameters in the data. You could e.g. create a role for each customer and have this filter based on e.g. a customer ID. A user will then only have access to his own role and only be able to see and search invoices in the shared indices just as if this only contained his/her data.

These features are available on the [Elastic Cloud Elasticsearch Service](https://www.elastic.co/cloud/elasticsearch-service), which is the easiest way to get access to this functionality. There is even a two week free trial so you can see if it meets your needs.

---

<div class="post-metadata">

**Author:** ![ea1987](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ea1987/32/51356_2.png) [@ea1987](https://discuss.elastic.co/u/ea1987)\
**Post date:** [September 7, 2018, 2:12pm UTC](https://discuss.elastic.co/t/help-advices-on-elasticsearch-implementation/147695/3 "2018-09-07T14:12:25Z")

</div>

Hi Christian,  
thank you for your suggestion! I will give a try, even if I don't like too much using a shared index because I think it limits my index management ability (for example different backup managements and so on..).  
I'm reading documentation, but I don't understand if it works in Kibana too.  
Thanks,

Andrea

---

<div class="post-metadata">

**Author:** ![ea1987](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ea1987/32/51356_2.png) [@ea1987](https://discuss.elastic.co/u/ea1987)\
**Post date:** [September 7, 2018, 4:02pm UTC](https://discuss.elastic.co/t/help-advices-on-elasticsearch-implementation/147695/4 "2018-09-07T16:02:33Z")

</div>

Ok, I understood how it works but it seems, according to what I read, that it only works with read API and not with Kibana. Isn't it?

> Document level security restricts the documents that users have read access to. In particular, it restricts which documents can be accessed from document-based read APIs.

Thanks

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 7, 2018, 4:56pm UTC](https://discuss.elastic.co/t/help-advices-on-elasticsearch-implementation/147695/5 "2018-09-07T16:56:39Z")

</div>

It works with Kibana as it uses the standard Elasticsearch APIs.

---

<div class="post-metadata">

**Author:** ![ea1987](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ea1987/32/51356_2.png) [@ea1987](https://discuss.elastic.co/u/ea1987)\
**Post date:** [September 17, 2018, 2:53pm UTC](https://discuss.elastic.co/t/help-advices-on-elasticsearch-implementation/147695/6 "2018-09-17T14:53:25Z")

</div>

Thank you Christian. I tried that and it seems to work well!

---

<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 15, 2018, 2:53pm UTC](https://discuss.elastic.co/t/help-advices-on-elasticsearch-implementation/147695/7 "2018-10-15T14:53:25Z")

</div>

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