Create or update a runtime field

PUT /api/data_views/data_view/{viewId}/runtime_field

Headers

  • kbn-xsrf string Required

    Cross-site request forgery protection

Path parameters

  • viewId string Required

    The ID of the data view fields you want to update.

application/json

Body Required

  • name string Required

    The name for a runtime field.

  • runtimeField object Required

    The runtime field definition object.

Responses

  • 200 application/json

    Indicates a successful call.

    Hide response attributes Show response attributes object
    • data_view object
    • fields array[object]
  • 400 application/json

    Bad request

    Hide response attributes Show response attributes object
    • error string Required
    • message string Required
    • statusCode number Required
PUT /api/data_views/data_view/{viewId}/runtime_field
curl \ --request PUT 'https://<KIBANA_URL>/api/data_views/data_view/{viewId}/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)" } } }