# Kibana Crashing when plotting scripted fields

**URL:** <https://discuss.elastic.co/t/kibana-crashing-when-plotting-scripted-fields/129548>\
**Category:** Kibana\
**Created:** [April 25, 2018, 6:25pm UTC](https://discuss.elastic.co/t/kibana-crashing-when-plotting-scripted-fields/129548 "2018-04-25T18:25:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![siddharth99](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@siddharth99](https://discuss.elastic.co/u/siddharth99)\
**Post date:** [April 25, 2018, 6:25pm UTC](https://discuss.elastic.co/t/kibana-crashing-when-plotting-scripted-fields/129548/1 "2018-04-25T18:25:17Z")

</div>

Hi, I'm running ELK 6.2 stack; I'm pretty new to ELK and am trying to setup a very straight-forward scripted field to subtract 2 values.

Field Name: delta  
Field lang: painless  
Script:  
if (!doc['bidpx'].empty && !doc['askpx'].empty) { return doc['askpx'].value - doc['bidpx'].value; } return 0;

The script is working correctly and I am able to see the correct output in the Discover tab; I'm also able to build visualizations on it for the most past. But when some of the visualization update (either in Visualization tab or in a Dashboard) kibana crashes with a weird message.

Fatal Error  
TypeError: d.split(...)[1] is undefined ([http://stonestudy45.skae.tower-research.com:8884/bundles/vendors.bundle.js?v=16588:12](http://stonestudy45.skae.tower-research.com:8884/bundles/vendors.bundle.js?v=16588:12))

Version: 6.2.2  
Build: 16588

Error: TypeError: d.split(...)[1] is undefined ([http://localhost:8884/bundles/vendors.bundle.js?v=16588:12](http://localhost:8884/bundles/vendors.bundle.js?v=16588:12))  
window.onerror@[http://localhost:8884/bundles/commons.bundle.js?v=16588:1:496447](http://localhost:8884/bundles/commons.bundle.js?v=16588:1:496447)

I have checked and I don't see any error messages on stdout/stderr for Elasticsearch or Kibana. Any help would be greatly appreciated since if I'm unable to resolve this then will need to adjust workflow and add new fields to the document.

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [April 25, 2018, 9:14pm UTC](https://discuss.elastic.co/t/kibana-crashing-when-plotting-scripted-fields/129548/2 "2018-04-25T21:14:55Z")

</div>

This certainly sounds like a bug somewhere in the code. Looks like the Kibana is expecting a string, but is getting undefined for some reason.

I encourage you to open a bug report on the [Kibana issue tracker](https://github.com/elastic/kibana/issues) so that someone can look into it.

---

<div class="post-metadata">

**Author:** ![siddharth99](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@siddharth99](https://discuss.elastic.co/u/siddharth99)\
**Post date:** [April 25, 2018, 10:01pm UTC](https://discuss.elastic.co/t/kibana-crashing-when-plotting-scripted-fields/129548/3 "2018-04-25T22:01:01Z")

</div>

Thanks Joe, I have created an issue [https://github.com/elastic/kibana/issues/18588](https://github.com/elastic/kibana/issues/18588)

---

<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:** [May 23, 2018, 10:01pm UTC](https://discuss.elastic.co/t/kibana-crashing-when-plotting-scripted-fields/129548/4 "2018-05-23T22:01:03Z")

</div>

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