Given the following Foo
entry which is stored in an ElasticSearch index :
"Foo": {
"x":"500",
"y":"200"
}
What is the correct syntax to create a sripted field within Kibana which adds the X
and Y
values together?
Given the following Foo
entry which is stored in an ElasticSearch index :
"Foo": {
"x":"500",
"y":"200"
}
What is the correct syntax to create a sripted field within Kibana which adds the X
and Y
values together?
If you index a document as follows
PUT scripted/doc/1
{
"Foo": {
"x":500,
"y":200
}
}
Then the syntax to sum the fields up in a scripted field is:
doc['Foo.x'].value + doc['Foo.y'].value
The x
and y
fields must be numeric fields. If you index them as strings you will get an error when trying to evaluate the scripted field.