Logstash / ElasticSearch - 如何处理父/子关系 [英] Logstash/ElasticSearch - How to deal with parent/child relationship
问题描述
PUT / test / _mapping / goals
{
目标:{
_all:{
enabled:false
},
_parent {
type:myparentdoc
},
_routing:{
required:true,
path:_id
properties:{
goals:{
type:long,
null_value:0
}
}
}
}
现在我想导入相应的文件与logstash。
如何配置我的logstash以提供父ID信息。
我尝试在弹性搜索输出配置中配置操作参数没有任何成功(基于弹性搜索文档批量处理的孩子文档)。
总而言之,我应该如何将 _parent 信息?
任何想法?
谢谢
最后我只是添加 _parent 信息:
filter {
mutate {
add_field => {_parent=> %{_ parentId}}
}
}
I have added a mapping in my elastic search index in order to have a child for my documents:
PUT /test/_mapping/goals
{
"goals": {
"_all": {
"enabled": false
},
"_parent": {
"type": "myparentdoc"
},
"_routing": {
"required": true,
"path": "_id"
},
"properties": {
"goals": {
"type": "long",
"null_value": 0
}
}
}
}
Now I would like to import the corresponding documents with logstash.
How can I configure my logstash in order to give the parent id information.
I tried to configure action parameter in elasticsearch output configuration without any success (based on elasticsearch documentation for bulk processing of children docs).
To summarize, how should I put _parent information?
Any idea?
Thanks
Finally I had just to add _parent information:
filter{
mutate{
add_field => { "_parent" => "%{_parentId}" }
}
}
这篇关于Logstash / ElasticSearch - 如何处理父/子关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!