# salt.states.elasticsearch

State module to manage Elasticsearch.

Added in version 2017.7.0.

salt.states.elasticsearch.alias_absent(name, index)

  Ensure that the index alias is absent.

  name

    Name of the index alias to remove

  index

    Name of the index for the alias

salt.states.elasticsearch.alias_present(name, index, definition=None)

  Ensure that the named index alias is present.

  name

    Name of the alias

  index

    Name of the index

  definition

    Optional dict for filters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html

  Example:

      mytestalias:
        elasticsearch.alias_present:
          - index: testindex
          - definition:
              filter:
                term:
                  user: kimchy

salt.states.elasticsearch.index_absent(name)

  Ensure that the named index is absent.

  name

    Name of the index to remove

salt.states.elasticsearch.index_present(name, definition=None)

  Ensure that the named index is present.

  name

    Name of the index to add

  definition

    Optional dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html

  Example:

      # Default settings
      mytestindex:
        elasticsearch_index.present

      # Extra settings
      mytestindex2:
        elasticsearch_index.present:
          - definition:
              settings:
                index:
                  number_of_shards: 10

salt.states.elasticsearch.index_template_absent(name)

  Ensure that the named index template is absent.

  name

    Name of the index to remove

salt.states.elasticsearch.index_template_present(name, definition, check_definition=False)

  Ensure that the named index template is present.

  name

    Name of the index to add

  definition

    Required dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html

  check_definition

    If the template already exists and the definition is up to date

  Example:

      mytestindex2_template:
        elasticsearch.index_template_present:
          - definition:
              template: logstash-*
              order: 1
              settings:
                number_of_shards: 1

salt.states.elasticsearch.pipeline_absent(name)

  Ensure that the named pipeline is absent

  name

    Name of the pipeline to remove

salt.states.elasticsearch.pipeline_present(name, definition)

  Ensure that the named pipeline is present.

  name

    Name of the index to add

  definition

    Required dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/master/pipeline.html

  Example:

      test_pipeline:
        elasticsearch.pipeline_present:
          - definition:
              description: example pipeline
              processors:
                - set:
                    field: collector_timestamp_millis
                    value: '{{ '{{' }}_ingest.timestamp{{ '}}' }}'

salt.states.elasticsearch.search_template_absent(name)

  Ensure that the search template is absent

  name

    Name of the search template to remove

salt.states.elasticsearch.search_template_present(name, definition)

  Ensure that the named search template is present.

  name

    Name of the search template to add

  definition

    Required dict for creation parameters as per http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html

  Example:

      test_pipeline:
        elasticsearch.search_template_present:
          - definition:
              inline:
                size: 10