[Resolved]Script is invalid for doc['kf4'].value + '-' + doc['kf5'].value

Hi Team,

In created a script field in kibana->Index Patter->Create script field with script is doc['kf4'].value + '-' + doc['kf5'].value

When I save the field, it tells me that 'Script is invalid.'
Please refer to below screenshot below:

Below is the data in elk for kf4 and kf5

Can you please advice what wrong with the syntax?

You should be using double quotes for the string, so it would be:
doc['kf4'].value + "-" + doc['kf5'].value

Hi Marius,

double quotes doesn't work as well.
Finally, doc['kf4.keyword].value + "-" + doc['kf5.keyword'].value works.


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