# Connecting documents from different kibana indexes

**URL:** https://discuss.elastic.co/t/connecting-documents-from-different-kibana-indexes/271983
**Category:** Kibana
**Created:** [May 3, 2021, 12:51pm UTC](https://discuss.elastic.co/t/connecting-documents-from-different-kibana-indexes/271983 "2021-05-03T12:51:10Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![LL\_FED](https://avatars.discourse-cdn.com/v4/letter/l/e47c2d/32.png) [@LL\_FED](https://discuss.elastic.co/u/LL_FED)
#### Post date: [May 3, 2021, 12:51pm UTC](https://discuss.elastic.co/t/connecting-documents-from-different-kibana-indexes/271983/1 "2021-05-03T12:51:10Z")

</div>

Hello Elastic-Community,  
I am wondering if there is a way to connect two datasets from two different indexes with each other to create a visualization.

**For example:**

From **Index\_1** I receive general informations of a device, that looks like this:

```auto
{
"DeviceName": "machine_1",
"ID": 001,
}

```

And from **Index\_2** I get temperature-values from this device, but i don't have the "DeviceName"-field:

```auto
{
"ID": 001,
"temperature": "20", 
"timestamp": "2021-04-15T07:34:33.079Z",
}

```

Now i want to create a **visualization** , where i can filter or **search for the "DeviceName"** such as "machine\_1" and get the current temperature and a chart with the temperatur over time.

Thanks for any kind of help!

---

<div class="post-metadata">

### Author: ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)
#### Post date: [May 3, 2021, 5:02pm UTC](https://discuss.elastic.co/t/connecting-documents-from-different-kibana-indexes/271983/2 "2021-05-03T17:02:11Z")

</div>

@timroes can we have more inputs here? Thank you.

---

<div class="post-metadata">

### Author: ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)
#### Post date: [May 3, 2021, 5:21pm UTC](https://discuss.elastic.co/t/connecting-documents-from-different-kibana-indexes/271983/3 "2021-05-03T17:21:11Z")

</div>

Hi,

this is unfortunately not really able that way. There is a join field type, but that's unfortunately not supported in Kibana. In general when working with search engines like Elasticsearch (in contrast to relational databases) it's recommended to denormalize data (instead of normalization what you might be used from a relational database), i.e. in this case including the device name into the second document as well. Given how Elasticsearch (and most search engines) are build technically, this is the preferred version for gaining the relevant speed and still be able to execute the desired queries you want.

Cheers,  
Tim

---

<div class="post-metadata">

### Author: ![Felix\_Roessel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felix_roessel/32/41623_2.png) [@Felix\_Roessel](https://discuss.elastic.co/u/Felix_Roessel)
#### Post date: [May 4, 2021, 4:17am UTC](https://discuss.elastic.co/t/connecting-documents-from-different-kibana-indexes/271983/4 "2021-05-04T04:17:05Z")

</div>

I agree to @timroes

There are also inbuilt possibilities to do so.  
You can use transforms to do the merge or you use the enrich processor on index time.  
I would use the second alternative in your case.

---

<div class="post-metadata">

### Author: ![LL\_FED](https://avatars.discourse-cdn.com/v4/letter/l/e47c2d/32.png) [@LL\_FED](https://discuss.elastic.co/u/LL_FED)
#### Post date: [May 4, 2021, 5:49am UTC](https://discuss.elastic.co/t/connecting-documents-from-different-kibana-indexes/271983/5 "2021-05-04T05:49:55Z")

</div>

@Felix_Roessel  
Can you please provide some further information to your suggestion. Where can I find these functionalities and how do I use them correctly?

---

<div class="post-metadata">

### Author: ![Felix\_Roessel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felix_roessel/32/41623_2.png) [@Felix\_Roessel](https://discuss.elastic.co/u/Felix_Roessel)
#### Post date: [May 4, 2021, 6:14am UTC](https://discuss.elastic.co/t/connecting-documents-from-different-kibana-indexes/271983/6 "2021-05-04T06:14:16Z")

</div>

You can find it in Kibana -\> Management - \> Ingest Pipelines  
There you configure a new ingest Pipeline for your data using the enrich processor.

> **[Introducing the enrich processor for Elasticsearch ingest nodes | Elastic Blog](https://www.elastic.co/de/blog/introducing-the-enrich-processor-for-elasticsearch-ingest-nodes)**
>
> Learn how to use the new enrich processor for ingest node. This new feature allows you to enrich Elasticsearch documents while they're indexed using reference data.

Finally you add this new pipeline as default pipeline to the Meeting index template of your main index.

---

<div class="post-metadata">

### Author: ![LL\_FED](https://avatars.discourse-cdn.com/v4/letter/l/e47c2d/32.png) [@LL\_FED](https://discuss.elastic.co/u/LL_FED)
#### Post date: [May 12, 2021, 12:26pm UTC](https://discuss.elastic.co/t/connecting-documents-from-different-kibana-indexes/271983/7 "2021-05-12T12:26:35Z")

</div>

@Felix_Roessel  
thank you for the information.

I was able to enrich a document with data from another index... perfect!!

At the time i create test-documents, which should be enriched, with the command:

`PUT myindex/_doc/mydocument?pipeline=my_enrich_pipeline`

Here it is easy to define that the document should use the specific pipeline.

But how/where do I define, that this pipeline should also be used for documents, which are send from elasticsearch?

---

<div class="post-metadata">

### Author: ![Felix\_Roessel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felix_roessel/32/41623_2.png) [@Felix\_Roessel](https://discuss.elastic.co/u/Felix_Roessel)
#### Post date: [May 15, 2021, 4:28am UTC](https://discuss.elastic.co/t/connecting-documents-from-different-kibana-indexes/271983/8 "2021-05-15T04:28:01Z")

</div>

A pipeline is always triggered on index time. To run elasticsearch documents through it you can use the reindex API.

---

<div class="post-metadata">

### Author: ![LL\_FED](https://avatars.discourse-cdn.com/v4/letter/l/e47c2d/32.png) [@LL\_FED](https://discuss.elastic.co/u/LL_FED)
#### Post date: [May 17, 2021, 7:36am UTC](https://discuss.elastic.co/t/connecting-documents-from-different-kibana-indexes/271983/9 "2021-05-17T07:36:16Z")

</div>

I added my pipeline as "default\_pipeline" in de index settings.

My pipeline enriches data with the match field: "ID"

But now i get the following error, when i receive data without the field "ID":

```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "field [ID] not present as part of path [ID]"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "field [ID] not present as part of path [ID]"
  },
  "status" : 400
}

```

Can I somehow define that a certain pipeline should only be used, when the field "ID" exists?

---

<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: [June 14, 2021, 7:36am UTC](https://discuss.elastic.co/t/connecting-documents-from-different-kibana-indexes/271983/10 "2021-06-14T07:36:29Z")

</div>

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