community.elastic.elastic_transform (1.1.2) — module

Manage Elasticsearch Transform Jobs.

| "added in version" 0.0.1 of community.elastic"

Authors: Rhys Campbell (@rhysmeister)

Install collection

Install with ansible-galaxy collection install community.elastic:==1.1.2


Add to requirements.yml

  collections:
    - name: community.elastic
      version: 1.1.2

Description

Manage Elasticsearch Transform Jobs.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a transform job with a pivot
  community.elastic.elastic_transform:
    name: ecommerce_transform1
    state: present
    source:
      index: "kibana_sample_data_ecommerce"
      query: {
          "term": {
            "geoip.continent_name": {
              "value": "Asia"
            }
          }
        }
    pivot:
      group_by: {
          "customer_id": {
            "terms": {
              "field": "customer_id"
            }
          }
        }
      aggregations: {
          "max_price": {
            "max": {
              "field": "taxful_total_price"
            }
          }
        }
    description: "Maximum priced ecommerce data by customer_id in Asia"
    dest:
      index: "kibana_sample_data_ecommerce_transform1"
      pipeline: "add_timestamp_pipeline"
    frequency: "5m"
    sync: {
        "time": {
          "field": "order_date",
          "delay": "60s"
        }
      }
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete a transform job called ecommerce_transform1
  community.elastic.elastic_transform:
    name: ecommerce_transform1
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Start a transform job called ecommerce_transform1
  community.elastic.elastic_transform:
    name: ecommerce_transform1
    state: started
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Stop a transform job called ecommerce_transform1
  community.elastic.elastic_transform:
    name: ecommerce_transform1
    state: stopped

Inputs

    
dest:
    description:
    - The destination for the transform.
    suboptions:
      index:
        description:
        - The destination index for the transform.
        required: true
        type: str
      pipeline:
        description:
        - The unique identifier for a pipeline.
        required: false
        type: str
    type: dict

name:
    aliases:
    - transform_id
    description:
    - The name of the transform job
    required: true
    type: str

sync:
    description:
    - Defines the properties transforms require to run continuously.
    suboptions:
      time:
        description:
        - Specifies that the transform uses a time field to synchronize the source and
          destination indices.
        required: true
        suboptions:
          delay:
            default: 60s
            description:
            - The time delay between the current time and the latest input data time.
            type: str
          field:
            description:
            - The date field that is used to identify new documents in the source.
            required: true
            type: str
        type: dict
    type: dict

pivot:
    description:
    - The pivot method transforms the data by aggregating and grouping it.
    - These objects define the group by fields and the aggregation to reduce the data.
    suboptions:
      aggregations:
        aliases:
        - aggs
        description:
        - Defines how to aggregate the grouped data.
        type: dict
      group_by:
        aliases:
        - groupby
        description:
        - Defines how to group the data.
        - More than one grouping can be defined per pivot.
        type: dict
    type: dict

state:
    choices:
    - present
    - absent
    - started
    - stopped
    default: present
    description:
    - State of the transform job
    type: str

cafile:
    description:
    - Path to ca file
    type: str

latest:
    description:
    - The latest method transforms the data by finding the latest document for each unique
      key.
    suboptions:
      sort:
        description:
        - Specifies the date field that is used to identify the latest documents.
        type: str
      unique_key:
        description:
        - Specifies an array of one or more fields that are used to group the data.
        elements: str
        type: list
    type: dict

source:
    description:
    - The source of the data for the transform.
    suboptions:
      index:
        description:
        - The source indices for the transform.
        - It can be a single index, an index pattern (for example, "my-index-*"), \ an
          array of indices (for example, ["my-index-000001", "my-index-000002"]), \ or
          an array of index patterns (for example, ["my-index-*", "my-other-index-*"].
        required: true
        type: raw
      query:
        description:
        - A query clause that retrieves a subset of data from the source index.
        type: dict
    type: dict

timeout:
    default: 30
    description:
    - Response timeout in seconds.
    type: int

settings:
    description:
    - Defines optional transform settings.
    suboptions:
      dates_as_epoch_millis:
        default: false
        description:
        - Defines if dates in the ouput should be written as ISO formatted string (default)
          or as millis since epoch.
        type: bool
      docs_per_second:
        default: null
        description:
        - Specifies a limit on the number of input documents per second.
        type: float
      max_page_search_size:
        default: 500
        description:
        - Defines the initial page size to use for the composite aggregation for each
          checkpoint.
        type: int
    type: dict

frequency:
    default: 1m
    description:
    - The interval between checks for changes in the source indices when the transform
      is running continuously.
    - Also determines the retry interval in the event of transient failures while the
      transform is searching or indexing.
    type: str

login_port:
    default: 9200
    description:
    - The Elastic server port to login to.
    required: false
    type: int

login_user:
    description:
    - The Elastic user to login with.
    - Required when I(login_password) is specified.
    required: false
    type: str

auth_method:
    choices:
    - ''
    - http_auth
    default: ''
    description:
    - Authentication Method.
    type: str

auth_scheme:
    choices:
    - http
    - https
    default: http
    description:
    - Authentication scheme.
    type: str

description:
    description:
    - A description of the transform job.
    type: str

login_hosts:
    default: localhost
    description:
    - The Elastic hosts to connect to.
    elements: str
    required: false
    type: list

login_password:
    description:
    - The password used to authenticate with.
    - Required when I(login_user) is specified.
    required: false
    type: str

defer_validation:
    default: false
    description:
    - When true, deferrable validations are not run.
    type: bool

connection_options:
    default: []
    description:
    - Additional connection options for Elasticsearch
    elements: dict
    type: list