# VIsualize 2 array in data table

**URL:** https://discuss.elastic.co/t/visualize-2-array-in-data-table/206017
**Category:** Kibana
**Created:** [October 31, 2019, 10:11am UTC](https://discuss.elastic.co/t/visualize-2-array-in-data-table/206017 "2019-10-31T10:11:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![DawitCh](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@DawitCh](https://discuss.elastic.co/u/DawitCh)
#### Post date: [October 31, 2019, 10:11am UTC](https://discuss.elastic.co/t/visualize-2-array-in-data-table/206017/1 "2019-10-31T10:11:31Z")

</div>

Hi,  
I'm trying to create a data table visualization from a log that contains 2 arrays.  
For example, the log has 2 fields which are a and b. In the Discover page, it will show

field value  
a aa,bb,cc,dd  
b 1,2,3,4  
\*\* _note_ this data is contained in single log\*\*

What I want to show is

**column a column b count**  
aa 1 1  
bb 2 1  
cc 3 1  
dd 4 1

What I get is

**column a column b count**  
aa 1 1  
aa 2 1  
aa 3 1  
aa 4 1  
bb 1 1  
bb 2 1  
bb 3 1  
bb 4 1  
cc 1 1  
cc 2 1  
cc 3 1  
cc 4 1  
dd 1 1  
dd 2 1  
dd 3 1  
dd 4 1

If it's possible to do what I want?

Thank you in advance for your reply,  
Dawit

---

<div class="post-metadata">

### Author: ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)
#### Post date: [November 1, 2019, 6:18pm UTC](https://discuss.elastic.co/t/visualize-2-array-in-data-table/206017/2 "2019-11-01T18:18:53Z")

</div>

To clarify, you want a set of keys that contain `a[i] b[i]`.

If so, you can solve this one of two ways. On the ingest side, you could transform your documents to merge a and b into a single array `["a[0] b[0]", "a[1] b[1]",... ]`. Then you could just create a data table for this new field.

You could also use a [scripted field](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html) to create this new field.

---

<div class="post-metadata">

### Author: ![DawitCh](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@DawitCh](https://discuss.elastic.co/u/DawitCh)
#### Post date: [November 4, 2019, 3:47am UTC](https://discuss.elastic.co/t/visualize-2-array-in-data-table/206017/3 "2019-11-04T03:47:24Z")

</div>

Thank you for the 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: [December 2, 2019, 3:47am UTC](https://discuss.elastic.co/t/visualize-2-array-in-data-table/206017/4 "2019-12-02T03:47:38Z")

</div>

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