say the event is like this:
{
"name": "xxx",
"data": {
"a": xxx
}
}
with logstash, how to just use inner data
field as document source send to elasticsearch, like:
{
"a": xxx
}
any response would be appreciated!
tried to use json
filter
filter {
json {
source => "data"
}
}
but seems like the event is already parsed as a json, the terminal just print this error message:
Error parsing json {:source=>"data", :raw=>{"a"=>xxx}, :exception=>java.lang.ClassCastException: org.jruby.RubyHash cannot be cast to org.jruby.RubyIO}
1条答案
按热度按时间t30tvxxf1#
仅供参考,找到一个答案https://discuss.elastic.co/t/move-subarrays-to-document-root/143876
只需使用
ruby
代码将嵌套字段移动到文档根,并使用remove
将所有其他字段移动到文档根