# Dynamically add new field to visualization

**URL:** https://discuss.elastic.co/t/dynamically-add-new-field-to-visualization/106051
**Category:** Kibana
**Created:** [November 1, 2017, 3:12pm UTC](https://discuss.elastic.co/t/dynamically-add-new-field-to-visualization/106051 "2017-11-01T15:12:45Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Igal\_Karlinsky](https://avatars.discourse-cdn.com/v4/letter/i/a87d85/32.png) [@Igal\_Karlinsky](https://discuss.elastic.co/u/Igal_Karlinsky)
#### Post date: [November 1, 2017, 3:12pm UTC](https://discuss.elastic.co/t/dynamically-add-new-field-to-visualization/106051/1 "2017-11-01T15:12:45Z")

</div>

Hi,

I wonder, is there a way to add new field to existing visualization dynamically?

Suppose I post CPU usage data per process like this:

1. { "date" : "00:00:10" , "CPU" : {"chrome" : 30 , "outlook" : 30 , "other" : 40}}
2. { "date" : "00:00:20" ,"CPU" : {"Firefox" : 90 , "other" : 10}}

I don't have a problem adding new mappings on the fly but is there a way to display all existing processes over time without changing the visualization?

---

<div class="post-metadata">

### Author: ![stevedearl](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@stevedearl](https://discuss.elastic.co/u/stevedearl)
#### Post date: [November 1, 2017, 4:49pm UTC](https://discuss.elastic.co/t/dynamically-add-new-field-to-visualization/106051/2 "2017-11-01T16:49:39Z")

</div>

Hi Igal,

If I've understood your question correctly then I use Timelion to achieve what you're looking for. I'm not sure if its possible with any of the other Kibana visualizations, but there are lots of people on here who know more than me so I'm sure you'll get an answer....!!

Below is an example of my Timelion visualization which is creating a series for each of the possible values within a particular ES field:

![image](https://us1.discourse-cdn.com/elastic/original/3X/b/e/beed2cc6df89fd7db9afaa8f83f5ec4d75390afb.png)

The dynamic labelling uses the fact that Timelion allows Regex (including capture groups) to auto-generate labels from your data. I'll be totally honest here - I grabbed this from another forum post - see [https://discuss.elastic.co/t/timelion-how-generate-label-dynamically/85072](https://discuss.elastic.co/t/timelion-how-generate-label-dynamically/85072)

I suspect the above link should tell you what you need to know to get this working in Timelion.

Hope that helps,  
Steve

---

<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: [November 1, 2017, 5:09pm UTC](https://discuss.elastic.co/t/dynamically-add-new-field-to-visualization/106051/3 "2017-11-01T17:09:30Z")

</div>

The answer above by Steve is talking about terms/values in a Field but not a new field.  
Kibana can't add a new field dynamically. It needs to be done programmatically as of now . Most recent versions of Kibana come with API where you can export your visualization JSON - modify it according to your needs and reimport it. But again, this wouldn't be dynamic in nature.

Thanks  
Rashmi

---

<div class="post-metadata">

### Author: ![Igal\_Karlinsky](https://avatars.discourse-cdn.com/v4/letter/i/a87d85/32.png) [@Igal\_Karlinsky](https://discuss.elastic.co/u/Igal_Karlinsky)
#### Post date: [November 1, 2017, 5:33pm UTC](https://discuss.elastic.co/t/dynamically-add-new-field-to-visualization/106051/4 "2017-11-01T17:33:53Z")

</div>

@rashmi @stevedearl - thanks for your input. I'll try Timelion.

---

<div class="post-metadata">

### Author: ![stevedearl](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@stevedearl](https://discuss.elastic.co/u/stevedearl)
#### Post date: [November 2, 2017, 8:17am UTC](https://discuss.elastic.co/t/dynamically-add-new-field-to-visualization/106051/5 "2017-11-02T08:17:10Z")

</div>

Hi Rashmi - good point, I may have misunderstood Igal's initial question.

---

<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: [November 30, 2017, 8:17am UTC](https://discuss.elastic.co/t/dynamically-add-new-field-to-visualization/106051/6 "2017-11-30T08:17:11Z")

</div>

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