logstash-filter

convert string to array based on pattern in logstash

不想你离开。 提交于 2019-12-11 17:24:28
问题 My original data. { message: { data: "["1,2","3,4","5,6"]" } } Now I want to convert value of data field to an array. So it should become: { message: { data: ["1,2", "3,4", "5,6"] } } By using mutate { gsub => ["data", "[\[\]]", ""] } I got rid of square brackets. After this, I tried splitting based on commas. But that won't work. Since my data has commas as well. I tried writing a dissect block but that is not useful. So how should I go ahead with this? 回答1: Have you tried the json filter?