opensearch-project / index-management-dashboards-plugin

🗃 Manage policies and jobs and automate periodic data operations in OpenSearch Dashboards
https://opensearch.org/docs/latest/im-plugin/index/
Apache License 2.0
14 stars 87 forks source link

[FEATURE]Loading a ready-made mapping file during the template creation #799

Open YANG-DB opened 1 year ago

YANG-DB commented 1 year ago

Is your feature request related to a problem? During the creation of an index template I need to import an existing mapping file to use as the schema for this template.

What solution would you like?

The purpose of this additional functionality is to allow the creation of a schema based (mapping) index (data-stream) using existing mapping files that are present in the plugin as part of the catalog deployment of pre-build schema used in the opensearch - Observability / Security Plugins.

What we need: Adding a load file option button for loading a ready made mapping file from the file system.

Screenshot 2023-06-29 at 2 34 51 PM

if the file contains composed templates (which do not already exist in the cluster) - the prompt will ask the user if he would like to load the components templates

For example the Logs mapping file that has inner composition of component templates

All these inner compositions relationships are explained and detailed in the catalog config for in the Observability schema

Functionality:

Do you have any additional context?

kamingleung commented 1 year ago

@YANG-DB Can't we achieve this by associating the pre-canned component templates to a template? We can associate component templates to a template on the UI since 2.7. image

YANG-DB commented 1 year ago

Actually the use case is that we want to generate the entire scope of both the index mapping including the component mapping that are referenced in that index mapping. We want this to be automated and not manually adding each component template

See the next logs.mapping example:

 },
  "composed_of": [
    "http_template",
    "communication_template"
  ],

This would prompt the dialog to load the component templates from the file system (folder?) And once the user select the folder all the depended component templates would be generated and the whole index template would also be generated without the user manually creating each components by himself

The main point here is to automate the entire index mapping hierarchy without the user having to manually create each part (component / index)

Another think to take into consideration is that index mapping may be subject for changes (versioning) so this also has to come into account in the template table UX

Screenshot 2023-06-29 at 4 41 30 PM
kamingleung commented 1 year ago

@YANG-DB I would like to clarify some of the points in this proposal, which may differ from the current create template workflow.

When you mentioned importing a mapping file to a template, does it: a) attach/associate component templates (containing mappings) to the template the user is creating or b) import the mapping structures into the template the user is creating without attaching/associating component templates?

dblock commented 5 months ago

[Triage -- attendees 1, 2, 3, 4, 5, 6, 7]

Looks like a reasonable proposal.