# Update Kibana for all visualisations to handle fields with null values

**URL:** <https://discuss.elastic.co/t/update-kibana-for-all-visualisations-to-handle-fields-with-null-values/243995>\
**Category:** Kibana\
**Created:** [August 6, 2020, 9:37am UTC](https://discuss.elastic.co/t/update-kibana-for-all-visualisations-to-handle-fields-with-null-values/243995 "2020-08-06T09:37:02Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbergmann](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rbergmann](https://discuss.elastic.co/u/rbergmann)\
**Post date:** [August 6, 2020, 9:37am UTC](https://discuss.elastic.co/t/update-kibana-for-all-visualisations-to-handle-fields-with-null-values/243995/1 "2020-08-06T09:37:02Z")

</div>

I understand that from v7+ there is an issue with the handling of null values in fields.  
This would check it.  
`doc[<field>].size()==0`

[https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html#\_accessing\_missing\_document\_values\_will\_throw\_an\_error](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html#_accessing_missing_document_values_will_throw_an_error)

Could someone please let me know how I should update Kibana so that I don't encounter this issue when creating visualisations through the UI.  
Thanks

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [August 6, 2020, 2:52pm UTC](https://discuss.elastic.co/t/update-kibana-for-all-visualisations-to-handle-fields-with-null-values/243995/2 "2020-08-06T14:52:42Z")

</div>

hi @rbergmann,

> [@rbergmann](#):
>
> how I should update Kibana

upgrade documentation is here [Upgrade Kibana | Kibana Guide [8.11] | Elastic](https://www.elastic.co/guide/en/kibana/current/upgrade.html) . That's probably the best way to start.

As for updating the scripts, you would need to add an `if`-check before actually accessing the field, and handle the condition explicitly.

```auto
if( doc['field'].size() == 0) { 
//...handle missing value....  
} else { 
//...happy path ... 
}

```

---

<div class="post-metadata">

**Author:** ![rbergmann](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rbergmann](https://discuss.elastic.co/u/rbergmann)\
**Post date:** [August 6, 2020, 3:19pm UTC](https://discuss.elastic.co/t/update-kibana-for-all-visualisations-to-handle-fields-with-null-values/243995/3 "2020-08-06T15:19:56Z")

</div>

Thanks @thomasneirynck for the quick response.  
I get that. For users that create visualisations via the Kibana UI using the "clicky" option, how could this check be included to make sure all visualisation scripts include it?  
Also, would you suggest we upgrade Kibana to the latest version? Would that fix this issue?

---

<div class="post-metadata">

**Author:** ![rbergmann](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rbergmann](https://discuss.elastic.co/u/rbergmann)\
**Post date:** [August 11, 2020, 5:53pm UTC](https://discuss.elastic.co/t/update-kibana-for-all-visualisations-to-handle-fields-with-null-values/243995/4 "2020-08-11T17:53:09Z")

</div>

@thomasneirynck could you please let us know if there is already a solution for this for Kibana UI visualisations and searches, not the scripted stuff you already answered.

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [August 11, 2020, 6:13pm UTC](https://discuss.elastic.co/t/update-kibana-for-all-visualisations-to-handle-fields-with-null-values/243995/5 "2020-08-11T18:13:49Z")

</div>

hi @rbergmann

> For users that create visualisations via the Kibana UI using the "clicky" option, how could this check be included to make sure all visualisation scripts include it?

for the "clicky"-users nothing really changes in how they should use the UX.

It does mean that for users who have existing scripted fields in an index pattern ([Index patterns has been renamed to data views. | Kibana Guide [8.11] | Elastic](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html)), you might have to add that if-check.

> Also, would you suggest we upgrade Kibana to the latest version? Would that fix this issue?

It's more of the other way around. If you upgrade (e.g from 6.x to 7.x), you would need to inspect your existing scripted-fields and see if they need that additional check. So upgrading will require you to add that `.size()` condition if you're reading out values from a document.

---

<div class="post-metadata">

**Author:** ![rbergmann](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rbergmann](https://discuss.elastic.co/u/rbergmann)\
**Post date:** [August 11, 2020, 10:00pm UTC](https://discuss.elastic.co/t/update-kibana-for-all-visualisations-to-handle-fields-with-null-values/243995/6 "2020-08-11T22:00:30Z")

</div>

Thanks @thomasneirynck for that response. We are not using scripted fields. See attached screenshot.

 ![ES_Screenshot](https://us1.discourse-cdn.com/elastic/original/3X/3/0/308e20d644464ff017409d5b317bafaae219a594.png)

---

<div class="post-metadata">

**Author:** ![rbergmann](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rbergmann](https://discuss.elastic.co/u/rbergmann)\
**Post date:** [August 12, 2020, 8:21am UTC](https://discuss.elastic.co/t/update-kibana-for-all-visualisations-to-handle-fields-with-null-values/243995/7 "2020-08-12T08:21:59Z")

</div>

Could it be a bug in Kibana 7.3.2? Would upgrading Kibana be an option worth trying?  
Here is another screenshot showing not very descriptive error when trying to view data via Discover:

 ![ES_Screenshot_1](https://us1.discourse-cdn.com/elastic/original/3X/1/3/139165fb20206f905018828e8d1f9605b4908ea4.png)

---

<div class="post-metadata">

**Author:** ![rbergmann](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rbergmann](https://discuss.elastic.co/u/rbergmann)\
**Post date:** [August 17, 2020, 7:00am UTC](https://discuss.elastic.co/t/update-kibana-for-all-visualisations-to-handle-fields-with-null-values/243995/8 "2020-08-17T07:00:06Z")

</div>

@thomasneirynck  
if you have a solution for this Kibana error I would very much appreciate to hear about it.  
Many thanks

---

<div class="post-metadata">

**Author:** ![rbergmann](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rbergmann](https://discuss.elastic.co/u/rbergmann)\
**Post date:** [August 20, 2020, 8:19am UTC](https://discuss.elastic.co/t/update-kibana-for-all-visualisations-to-handle-fields-with-null-values/243995/9 "2020-08-20T08:19:49Z")

</div>

@thomasneirynck I take it there is no fix for this Kibana bug yet?

---

<div class="post-metadata">

**Author:** ![rbergmann](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rbergmann](https://discuss.elastic.co/u/rbergmann)\
**Post date:** [August 26, 2020, 6:58am UTC](https://discuss.elastic.co/t/update-kibana-for-all-visualisations-to-handle-fields-with-null-values/243995/10 "2020-08-26T06:58:23Z")

</div>

@thomasneirynck - is there any solution for Kibana visualisations?

---

<div class="post-metadata">

**Author:** ![rbergmann](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rbergmann](https://discuss.elastic.co/u/rbergmann)\
**Post date:** [September 4, 2020, 8:39am UTC](https://discuss.elastic.co/t/update-kibana-for-all-visualisations-to-handle-fields-with-null-values/243995/11 "2020-09-04T08:39:03Z")

</div>

@thomasneirynck - we are looking at getting your professional support, have requested pricing information.

Just loading 40 days of indexes in Kibana Discover throws this not very useful error:

SearchError: unknown error  
at [https://fi-sain.teavaro.net/bundles/commons.bundle.js:5:974773](https://fi-sain.teavaro.net/bundles/commons.bundle.js:5:974773)  
at processQueue ([https://fi-sain.teavaro.net/built\_assets/dlls/vendors.bundle.dll.js:499:199747](https://fi-sain.teavaro.net/built_assets/dlls/vendors.bundle.dll.js:499:199747))  
at [https://fi-sain.teavaro.net/built\_assets/dlls/vendors.bundle.dll.js:499:200710](https://fi-sain.teavaro.net/built_assets/dlls/vendors.bundle.dll.js:499:200710)  
at Scope.$digest ([https://fi-sain.teavaro.net/built\_assets/dlls/vendors.bundle.dll.js:499:210518](https://fi-sain.teavaro.net/built_assets/dlls/vendors.bundle.dll.js:499:210518))  
at Scope.$apply ([https://fi-sain.teavaro.net/built\_assets/dlls/vendors.bundle.dll.js:499:213504](https://fi-sain.teavaro.net/built_assets/dlls/vendors.bundle.dll.js:499:213504))  
at done ([https://fi-sain.teavaro.net/built\_assets/dlls/vendors.bundle.dll.js:499:133057](https://fi-sain.teavaro.net/built_assets/dlls/vendors.bundle.dll.js:499:133057))  
at completeRequest ([https://fi-sain.teavaro.net/built\_assets/dlls/vendors.bundle.dll.js:499:136850](https://fi-sain.teavaro.net/built_assets/dlls/vendors.bundle.dll.js:499:136850))  
at XMLHttpRequest.requestError ([https://fi-sain.teavaro.net/built\_assets/dlls/vendors.bundle.dll.js:499:135713](https://fi-sain.teavaro.net/built_assets/dlls/vendors.bundle.dll.js:499:135713))

Any help here would be much appreciated.

---

<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 2, 2020, 8:39am UTC](https://discuss.elastic.co/t/update-kibana-for-all-visualisations-to-handle-fields-with-null-values/243995/12 "2020-10-02T08:39:06Z")

</div>

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