Create a runtime field
Path parameters
-
viewId
string Required An identifier for the data view.
Body
Required
-
name
string Required The name for a runtime field.
-
runtimeField
object Required The runtime field definition object.
POST
/api/data_views/data_view/{viewId}/runtime_field
curl \
--request POST http://localhost:5622/api/data_views/data_view/ff959d40-b880-11e8-a6d9-e546fe2bba5f/runtime_field \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: string" \
--data '{"name":"runtimeFoo","runtimeField":{"type":"long","script":{"source":"emit(doc[\"foo\"].value)"}}}'
Request example
{
"name": "runtimeFoo",
"runtimeField": {
"type": "long",
"script": {
"source": "emit(doc[\"foo\"].value)"
}
}
}
Response examples (200)
{}