logstash - 如何在logstash中检查文档是否存在
问题描述
我有一个索引,其中包含使用 join 的父级和子级,但我不想为不存在的父级添加子级。所以我想要一个 if 来检查某个文档是否存在一个 id。就像是:
if(doc_id EXISTS %{parentid}){
}
我将如何为此编写 if ?当它存在时,它是一个如果。
解决方案
@Tristan 你能修好它吗?我需要做类似的事情。有了这个我可以检查它是否存在,但我不知道如何让结果继续:
filter{
http {
url => "http://localhost:9200/%{[@metadata][miEntidad]}/_search"
http_method => "post"
format => "message"
content_type => "application/json; charset=UTF-8"
message => '{"query": { "term": { "_id": "%{[id]}" } }}'
}
}
推荐阅读
- json - 将 python 数据转换为 json 并将其作为对 axios 函数的响应发送
- javascript - 平滑的 CSS 背景图像过渡
- reactjs - 缩小多少会减少文件大小?
- java - 接收两个自然数并计算其中一个出现在另一个中的次数。爪哇
- php - 如何从展开的自定义字段名称列表中删除最后一个逗号
- spring-boot - spring boot 微服务端到端测试,带有黄瓜和数据库验证
- java - 用高效的算法从数组中获取缺失的数字?‽?
- c++ - 如何使用 std::unique_ptr 作为类的静态映射
- vue.js - (Vue.js) 如何在 'Vue.js' 上使用 github 页面
- javascript - 我怎样才能使滚动锁定?