본문 바로가기

내가 당면한 문제와 해결방안

logstash nested value to root value

require 'json'
begin
	jsonn_json = JSON.parse(event.get('jsonn').to_s || '{}')
    jsonn_json.each {|k,v|
		event.set(k, v)
	}
    event.remove('jsonn')
rescue Exception => e
	event.tag('something happens in jsonn')
end

: discuss.elastic.co/t/how-to-dynamically-move-nested-key-value-to-root-level/180006/2?u=ohoroyoi

'내가 당면한 문제와 해결방안' 카테고리의 다른 글

logstash conf  (0) 2020.06.16
alias 변경 예시  (0) 2020.06.16
ruby text to json  (0) 2020.06.12
create index with mapping  (0) 2020.06.12
create geo_shape using latitude and longitude  (0) 2020.06.11