elasticsearch - 使用 Kibana 6.0 或 7+ (v7.0.1) 从控制台创建索引模式

标签 elasticsearch lucene request kibana

我最近将我的 ElasticStack 实例从 5.5 升级到 6.0,这个版本的一些重大变化似乎损害了我的管道。我有一个脚本,它根据 ElasticSearch 中的索引自动为一些相似索引组创建索引模式。问题是随着 6.0 版本的新映射更改,我无法从控制台添加任何新的索引模式。这是我在 5.5 中使用并运行良好的请求:

curl -XPOST "http://localhost:9200/.kibana/index-pattern" -H 'Content-  Type: application/json' -d'
{
  "title" : "index_name",
  "timeFieldName" : "execution_time"
}'

这是我现在在 6.0 中从 ElasticSearch 得到的响应:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Rejecting mapping update to [.kibana] as the final mapping would have more than 1 type: [index-pattern, doc]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "Rejecting mapping update to [.kibana] as the final mapping would have more than 1 type: [index-pattern, doc]"
  },
  "status": 400
}

我如何从控制台添加索引模式来避免这种多重映射问题?

最佳答案

URL 在 6.0.0 版本中已经更改,这里是新的 URL:

http://localhost:9200/.kibana/doc/doc:index-pattern:my-index-pattern-name 

This CURL should work for you:

curl -XPOST "http://localhost:9200/.kibana/doc/index-pattern:my-index-pattern-name" -H 'Content-Type: application/json' -d'
{
  "type" : "index-pattern",
  "index-pattern" : {
    "title": "my-index-pattern-name*",
    "timeFieldName": "execution_time"
  }
}'

关于elasticsearch - 使用 Kibana 6.0 或 7+ (v7.0.1) 从控制台创建索引模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47410250/

相关文章:

elasticsearch - 无法让 Elasticsearch Highlight 工作

java - 如何使用 Lucene、Highlighter 和 StandardAnalyzer 通过 Hibernate 搜索引擎获取文本片段

forms - 如何在Dart中从服务器写入HTML元素

elasticsearch - ElasticsearchIllegalArgumentException [suggester [completion]需要设置上下文]

php - 我在哪里可以分享我对 elasticsearch php 供应商的基准测试结果

elasticsearch - 如何使用Elasticsearch处理多个更新/删除?

apache - 语法错误,使用fq(过滤查询)时无法从lucene StandardQueryparser进行解析

solr - 所有字段的默认搜索

javascript - 如何在Angular 6中发送ajax请求?

swift - iOS 11 中的位置访问请求