put-transform.asciidoc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[put-data-frame-transform]]
  4. === Create {dataframe-transforms} API
  5. ++++
  6. <titleabbrev>Create {dataframe-transforms}</titleabbrev>
  7. ++++
  8. Instantiates a {dataframe-transform}.
  9. ==== Request
  10. `PUT _data_frame/transforms/<data_frame_transform_id>`
  11. //===== Description
  12. ==== Path Parameters
  13. `data_frame_transform_id` (required)::
  14. (string) Identifier for the {dataframe-transform}. This identifier can contain
  15. lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It
  16. must start and end with alphanumeric characters.
  17. ==== Request Body
  18. `source`:: The source index or index pattern.
  19. `dest`:: The destination index.
  20. `pivot`:: Defines the pivot function `group by` fields and the aggregation to
  21. reduce the data.
  22. //==== Authorization
  23. ==== Examples
  24. The following example creates a {dataframe-transform} for the {kib} eCommerce
  25. sample data:
  26. [source,js]
  27. --------------------------------------------------
  28. PUT _data_frame/transforms/ecommerce_transform
  29. {
  30. "source": "kibana_sample_data_ecommerce",
  31. "dest": "kibana_sample_data_ecommerce_transform",
  32. "pivot": {
  33. "group_by": {
  34. "customer_id": {
  35. "terms": {
  36. "field": "customer_id"
  37. }
  38. }
  39. },
  40. "aggregations": {
  41. "max_price": {
  42. "max": {
  43. "field": "taxful_total_price"
  44. }
  45. }
  46. }
  47. }
  48. }
  49. --------------------------------------------------
  50. // CONSOLE
  51. // TEST[skip:add sample kibana data]
  52. When the transform is created, you receive the following results:
  53. [source,js]
  54. ----
  55. {
  56. "acknowledged" : true
  57. }
  58. ----
  59. // NOTCONSOLE