Skip to content

[BUG] Data-Prepper is still using the deprecated _template path when creating ES templates #3052

@thomass4t

Description

@thomass4t

Describe the bug
When using a sink with the parameters template_file and ism_policy_file, an OpenSearch template is automatically created. However, this is not visible in the dashboard because it uses the old path _template instead of the new one _index_template
It's probably more an improvement to stay compatible with newer versions.

To Reproduce
Steps to reproduce the behavior:

  1. Configure a sink, e.g.
  sink:
    - opensearch:
        hosts: [ "https://127.0.0.1:9200" ]
        index: "test_logs"
        number_of_shards: 1
        number_of_replicas: 0
        template_file: "/opt/data-prepper/pipelines/log.template"
        ism_policy_file: "/opt/data-prepper/pipelines/log.policy"
  1. The log.template looks like this:
{
  "version": 1,
  "settings": {
      "index": {
        "opendistro": {
          "index_state_management": {
            "rollover_alias": "test_logs"
          }
        },
        "number_of_shards": "1",
        "number_of_replicas": "0"
      }
  },
  "mappings": {
      "properties": {
        "date": {
          "type": "float"
        },
        "level": {
          "type": "keyword"
        },
        "log": {
          "type": "keyword"
        },
        "logger": {
          "type": "text"
        },
        "message": {
          "type": "text"
        },
        "time": {
          "type": "date"
        }
      }
    }
}
  1. GET _template shows the new template, created by data-prepper. Deletion only works in the path _template/ and not in _index_template/.

Screenshots

Environment (please complete the following information):

  • OS: Ubuntu 22.04 LTS
  • Data-prepper: 2.3.2
  • OpenSearch 2.8.0

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions