Skip to content

Instantly share code, notes, and snippets.

@jakub-g
Created June 25, 2019 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakub-g/66ecd44aa74f1df9f251cfdcd823e66e to your computer and use it in GitHub Desktop.
Save jakub-g/66ecd44aa74f1df9f251cfdcd823e66e to your computer and use it in GitHub Desktop.
kibana adhoc scripted field vs scripted field defined in panel

scripted field

if (!doc['data.request_response_time'].empty) {
  return doc['data.request_response_time'].value + doc['data.response_to_boot_start_time'].value + doc['data.boot_def_time'].value + doc['data.dmp_call_time'].value + doc['data.dmp_create_time'].value
}

return null

advanced query

{
  "script": {
    "inline": "doc['data.request_response_time'].value + doc['data.response_to_boot_start_time'].value + doc['data.boot_def_time'].value + doc['data.dmp_call_time'].value + doc['data.dmp_create_time'].value",
    "lang": "painless"
  }
}
@jakub-g
Copy link
Author

jakub-g commented Jun 25, 2019

  • It seems that it is not possible to do search queries over a scripted field in the same way as with normal fields

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment