在OpenSearch仪表板中是否可以创建类似于“myindex:logstash-012”这样的索引?

huangapple go评论56阅读模式
英文:

Is it possible to create index like myindex:logstash-012 in opensearch dashbaord

问题

我想要创建类似myindex:logstash-012的索引,这样我就可以在opensearch仪表板中创建索引模式myindex:logs*

每次我都遇到以下错误

{
  "error": {
    "root_cause": [
      {
        "type": "invalid_index_name_exception",
        "reason": "Invalid index name [my-test:test], must not contain ':'",
        "index": "my-test:test",
        "index_uuid": "_na_"
      }
    ],
    "type": "invalid_index_name_exception",
    "reason": "Invalid index name [my-test:test], must not contain ':'",
    "index": "my-test:test",
    "index_uuid": "_na_"
  },
  "status": 400
}

是否有实现这种索引模式的方法?我尝试了别名和索引模板,但都没有奏效。

谢谢

英文:

I wanted to create index like myindex:logstash-012 so I can create index pattern myindex:logs* in opensearch dashbaord.

Every time I`m getting is following error

{
  "error": {
    "root_cause": [
      {
        "type": "invalid_index_name_exception",
        "reason": "Invalid index name [my-test:test], must not contain ':'",
        "index": "my-test:test",
        "index_uuid": "_na_"
      }
    ],
    "type": "invalid_index_name_exception",
    "reason": "Invalid index name [my-test:test], must not contain ':'",
    "index": "my-test:test",
    "index_uuid": "_na_"
  },
  "status": 400
}

Is there any way to achieve this index pattern. I tried with alias ans index templates but nothing worked.

thanks

答案1

得分: 0

不可以在索引名称中使用列名(自 Elasticsearch 版本 7 起不再支持,而 OpenSearch 是基于 v7.10.x 的分支)。这是索引名称中禁止使用的字符的完整列表:https://opensearch.org/docs/2.5/api-reference/index-apis/create-index/#index-naming-restrictions

但是,您可以使用下划线或句点来达到相同的效果。

英文:

no, you cannot use columns in your index name (that's not possible since elasticsearch v7, and opensearch is a fork of v7.10.x). Here is the full list of forbidden chars in the index name: https://opensearch.org/docs/2.5/api-reference/index-apis/create-index/#index-naming-restrictions

but, I mean, you could achieve the same with an underscore or a dot

huangapple
  • 本文由 发表于 2023年2月23日 23:28:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/75546903.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定