在我的自定义模板中添加断字分解符后,logstash无法安装它:“得到响应代码'500',正在通过URL与Elasticsearch联系...”。
我已经有不同的令牌过滤器,例如停用词和词干提取器,并且用于正常工作的模板。也可以将带有单词列表作为数组的字典分解器工作。当我同时提供单词列表和连字符模式的路径时,问题就开始于我提供的单词列表路径和连字符分解。我尝试了绝对路径和相对路径。当我使用kubernetes时,我已确保使用configmap在pod上存在文件。 elasticsearch版本是7.1.1。和logstash版本6.2.3。我的假设是路径无法解析,或者文件与我的elasticsearch或logstash版本不兼容。但是,我已经根据elasticsearch文档https://www.elastic.co/guide/en/elasticsearch/reference/7.1/analysis-compound-word-tokenfilter.html
中的手册实施了分解这是我的索引设置。
"index.refresh_interval":"5s",
"analysis":{
"filter":{
"english_stop":{
"type":"stop",
"stopwords":"_english_"
},
"light_english_stemmer":{
"type":"stemmer",
"language":"light_english"
},
"english_possessive_stemmer":{
"type":"stemmer",
"language":"possessive_english"
},
"german_stop":{
"type":"stop",
"stopwords":"_german_"
},
"german_stemmer":{
"type":"stemmer",
"language":"light_german"
},
"german_hyphenation_decompounder": {
"type" : "hyphenation_decompounder",
"word_list_path": "/logstash/config/german_dictionary.txt",
"hyphenation_patterns_path": "/logstash/config/hyphentation_grammar_ngerman.xml",
"max_subword_size": 22
}
},
"analyzer":{
"custom_english":{
"tokenizer":"standard",
"filter":[
"lowercase",
"english_stop",
"english_possessive_stemmer",
"light_english_stemmer"
]
},
"custom_german":{
"type": "custom",
"tokenizer":"standard",
"filter":[
"lowercase",
"german_stop",
"german_normalization",
"german_stemmer",
"german_hyphenation_decompounder"
]
}
}
}
},
这是我安装mmy自定义模板的方式:
template => "/logstash/config/elasticsearch-template.custom.json"
template_overwrite => true
template_name => "mytemplate"
我想知道错误响应'500'的含义,以及尽管遵循了官方手册,却为什么收到此消息。