put-transform.asciidoc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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`:: (object) The source configuration, consisting of `index` and optionally
  19. a `query`.
  20. `dest`:: (object) The destination configuration, consisting of `index`.
  21. `pivot`:: Defines the pivot function `group by` fields and the aggregation to
  22. reduce the data.
  23. //==== Authorization
  24. ==== Examples
  25. The following example creates a {dataframe-transform} for the {kib} eCommerce
  26. sample data:
  27. [source,js]
  28. --------------------------------------------------
  29. PUT _data_frame/transforms/ecommerce_transform
  30. {
  31. "source": {
  32. "index": "kibana_sample_data_ecommerce",
  33. "query": {
  34. "term": {
  35. "geoip.continent_name": {
  36. "value": "Asia"
  37. }
  38. }
  39. }
  40. },
  41. "dest": {
  42. "index": "kibana_sample_data_ecommerce_transform"
  43. },
  44. "pivot": {
  45. "group_by": {
  46. "customer_id": {
  47. "terms": {
  48. "field": "customer_id"
  49. }
  50. }
  51. },
  52. "aggregations": {
  53. "max_price": {
  54. "max": {
  55. "field": "taxful_total_price"
  56. }
  57. }
  58. }
  59. }
  60. }
  61. --------------------------------------------------
  62. // CONSOLE
  63. // TEST[skip:add sample kibana data]
  64. When the transform is created, you receive the following results:
  65. [source,js]
  66. ----
  67. {
  68. "acknowledged" : true
  69. }
  70. ----
  71. // NOTCONSOLE