gpt4 book ai didi

elasticsearch - 无法将非对象映射与机器学习(测试版)模块中的对象映射错误合并

转载 作者:行者123 更新时间:2023-11-29 02:56:04 26 4
gpt4 key购买 nike

我正在试用 x 包中的新机器学习模块。我试图及时识别 HTTP 访问日志中的罕见响应代码。我的日志存储在 elasticsearch 中,如下所示:

{
"_index": "logstash-2017.05.18",
"_type": "Accesslog",
"_id": "AVxvVfFGdMmRr-0X-J5P",
"_version": 1,
"_score": null,
"_source": {
"request": "/web/Q123/images/buttons/asdf.gif",
"server": "91",
"auth": "-",
"ident": "-",
"verb": "GET",
"type": "Accesslog",
"path": "/path/to/log",
"@timestamp": "2017-05-18T10:20:00.000Z",
"response": "304",
"clientip": "1.1.1.1",
"@version": "1",
"host": "ip-10-10-10-10",
"httpversion": "1.1",
"timestamp": "18/May/2017:10:20:00 +0530"
},
"fields": {
"@timestamp": [
1495102800000
]
}

我添加了一个检测器,我将函数选为“稀有”,将 by_field_name 选为“响应”。但是当我保存作业时出现以下错误:

Save failed: [illegal_argument_exception] Can't merge a non object mapping [response] with an object mapping [response]

请帮忙。

最佳答案

错误消息表示您正在尝试更改现有映射。然而,这在 Elasticsearch 中是不可能的。映射一旦创建,便无法更改。

As explained by Shay Banon himself :

You can't change existing mapping type, you need to create a new index with the correct mapping and index the data again.

所以你必须创建一个新的索引来创建这个映射。根据情况,你要么

  • 创建一个额外的索引,或者
  • 删除当前索引并从头开始重新创建它。

当然,在后一种情况下,您将丢失索引中的所有数据,因此请做好相应准备。

关于elasticsearch - 无法将非对象映射与机器学习(测试版)模块中的对象映射错误合并,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44435624/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com