How to create a new script field using existing script fields

(surendra) #1

I want to create a new scripted field using existing scripted fields in kibana but my scripting is throwing null pointer exception .

Two script fields, total_hours and new_hours.

I want difference of these two as new scripting field.

(Tim Roes) #2


that doesn't work unfortunately. You can't get access to another scripted field inside a scripted field (since that way Elasticsearch would need to know in which order to compile them and you could end up with cyclic dependencies). You'll basically need to copy over the script of those 2 fields, and use them directly in the third field you want to create.


(surendra) #3

Thank you for answer. But, copying the scripts of two script fields and use in third field does not have increase the load? Do we have any tips to avoid performance issues here?

(Tim Roes) #4

It will slightly increase the load, but it depends on how complex those scripts are.

(system) #5

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