elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.61k stars 8.22k forks source link

Index template creation fails to accept provided JSON #70316

Open ajoliveira opened 4 years ago

ajoliveira commented 4 years ago

Kibana version: 7.8.0, 7.7.1

Elasticsearch version: 7.8.0, 7.7.1

Server OS version: macOS Catalina - 10.15.5 (19F101)

Browser version: Chrome - Version 83.0.4103.106 (Official Build) (64-bit) Firefox - 77.0.1 (64-bit)

Browser OS version: macOS Catalina - 10.15.5 (19F101)

Original install method (e.g. download page, yum, from source, etc.): tar.gz

Describe the bug: Trying to create an index template via Kibana UI, if you use the 'Load JSON' option can lead to it NOT being acknowledged and submitted. The user is required to actually click the 'Advanced Options' sub-tab either before or after using the 'Load JSON' option for it to take.

Steps to reproduce:

  1. Go to Stack Management -> Index Management -> Index Templates (/app/kibana#/management/elasticsearch/index_management/templates)
  2. Click 'Create a template'
  3. Logistics - Enter name and index pattern (ex: test & test-*), click Next
  4. Index Settings - Enter index settings (ex: {"number_of_replicas":1} ), click Next
  5. Mappings - DO NOT CLICK on any sub-tabs (ex: Mapped fields, Dynamic templates or Advanced options), click 'Load JSON' link
  6. Load JSON popup - Enter JSON, ex:
    {
    "mappings": {
    "_routing": {
      "required": false
    },
    "_meta": {},
    "dynamic": false,
    "_source": {
      "excludes": [],
      "includes": [],
      "enabled": true
    },
    "properties": {}
    }
    }

    Click 'Load and overwrite', click Next

  7. Aliases - click Next
  8. Review Template - click 'Request' sub tab ... JSON that was uploaded was not accepted

Expected behavior: JSON provided should be accepted even without clicking on 'Advanced Options' tab ... or if required, Kibana should automatically do that for user. If you go back to step 5 above and click the 'Advanced Options' sub-tab before or after loading JSON, it will be accepted and be shown in the final request.

Screenshots (if relevant):

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

Any additional context:

elasticmachine commented 3 years ago

Pinging @elastic/es-ui (Team:Elasticsearch UI)

sebelga commented 3 years ago

Thanks for raising this @ajoliveira and sorry for the late answer. I try to reproduce but it seems that the issue you found is because you provided the object with the "mappings" property.

I tested with only the content

{
    "_routing": {
      "required": false
    },
    "_meta": {},
    "dynamic": false,
    "_source": {
      "excludes": [],
      "includes": [],
      "enabled": true
    },
    "properties": {}
  }

and did the mappings settings in the preview

Screenshot 2021-04-26 at 09 39 51
sebelga commented 3 years ago

I will change it from bug to enhancement to see how we could improve the copy to indicate this clearer in the UI. 👍

elasticmachine commented 1 month ago

Pinging @elastic/kibana-management (Team:Kibana Management)