# Correlate data from two different saved searches and plot it into the same graph

**URL:** <https://discuss.elastic.co/t/correlate-data-from-two-different-saved-searches-and-plot-it-into-the-same-graph/133572>\
**Category:** Kibana\
**Created:** [May 28, 2018, 4:29pm UTC](https://discuss.elastic.co/t/correlate-data-from-two-different-saved-searches-and-plot-it-into-the-same-graph/133572 "2018-05-28T16:29:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mc84](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@mc84](https://discuss.elastic.co/u/mc84)\
**Post date:** [May 28, 2018, 4:29pm UTC](https://discuss.elastic.co/t/correlate-data-from-two-different-saved-searches-and-plot-it-into-the-same-graph/133572/1 "2018-05-28T16:29:41Z")

</div>

Hi to all,  
I have two saved search, the one is called `api`, and looks something like:

```
+-----------------------+--------+-------------------+-----------------------+
| @timestamp | @id | related_func_id | integration_latency |
+-----------------------+--------+-------------------+-----------------------+
| 28-May-18 03:40.001 | 1 | id_a | 250 |
| 28-May-18 03:41.001 | 2 | id_b | 321 |
| 28-May-18 03:42.001 | 3 | id_c | 519 |
+-----------------------+--------+-------------------+-----------------------+

```

the second is called `function` and it looks like this:

```
+-----------------------+--------+------------+
| @timestamp | @id | duration |
+-----------------------+--------+------------+
| 28-May-18 03:40.100 | id_a | 100 |
| 28-May-18 03:41.80 | id_b | 51 |
| 28-May-18 03:42.45 | id_c | 42 |
+-----------------------+--------+------------+

```

This two graphs means, that: the api with @id _1_ takes 250ms to complete, and of these 250ms, 100 were spent to execute the function with id _id\_a_. The `api.related_func_id` could be seen as a hypothetical join with `function.@id`.

What I would is a graph like

```
^ y
|
| +-----+ <--- 250 ms
| |XXXXX|
| |XXXXX|
| |XXXXX|
| |XXXXX|
| |XXXXX|
| |XXXXX|
| +-----+ <--- 100 ms
| |.....|
| |.....|
| |.....|
| |.....|
+----------------------+-----+----------------------> x

```

I would correlate this search into the same graph, for example, a stacked histogram like this. Can I correlate this in Kibana? How can I do this?

---

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [May 29, 2018, 11:34pm UTC](https://discuss.elastic.co/t/correlate-data-from-two-different-saved-searches-and-plot-it-into-the-same-graph/133572/2 "2018-05-29T23:34:56Z")

</div>

This is not something that Kibana supports today.

[APM](http://co/guide/en/apm/get-started/current/overview.html) accomplishes similar capabilities. All of that project is open-source so you're more than welcome to see how their plugin was built.

---

<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 26, 2018, 11:34pm UTC](https://discuss.elastic.co/t/correlate-data-from-two-different-saved-searches-and-plot-it-into-the-same-graph/133572/3 "2018-06-26T23:34:56Z")

</div>

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