Spaces method and path for this operation:
post /s/{space_id}/api/data_views/data_view/{viewId}/runtime_field/{fieldName}
Refer to Spaces for more information.
Update an existing runtime field in a data view. Only the fields provided in the request body are updated.
POST
/api/data_views/data_view/{viewId}/runtime_field/{fieldName}
curl
curl \
-X POST "${KIBANA_URL}/api/data_views/data_view/${DATA_VIEW_ID}/runtime_field/${FIELD_NAME}" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{"runtimeField":{"type":"long","script":{"source":"emit(doc['"'"'timestamp'"'"'].value.getHour())"}}}'
POST kbn://api/data_views/data_view/{viewId}/runtime_field/{fieldName}
{"runtimeField":{"type":"long","script":{"source":"emit(doc['timestamp'].value.getHour())"}}}
Request example
Update the script of an existing runtime field.
{
"runtimeField": {
"script": {
"source": "emit(doc[\"bar\"].value)"
}
}
}