Mam plik JSON, który wysyłam do ES poprzez logstash. Chciałbym usunąć 1 pole (To głębokie pole) w JSON - TYLKO jeśli wartość jest równa NULL.Logstash - usuń głębokie pole z pliku json
Część JSON jest:
"input": {
"startDate": "2015-05-27",
"numberOfGuests": 1,
"fileName": "null",
"existingSessionId": "XXXXXXXXXXXXX",
**"radius": "null",**
"nextItemReference": "51",
"longitude": -99.12,
"endDate": "2015-05-29",
"thumbnailHeight": 200,
"thumbnailWidth": 300,
"latitude": 19.42,
"numOfRooms": "1"
},
Część w pliku logstash.conf
jest:
if [input.radius] == "null" {
mutate {
remove_field => [ "input.radius" ]
}
}
Jest wewnątrz filtra oczywiście.
Jak mogę usunąć to pole, jeśli wartość jest zerowa?
Wielkie dzięki, że działa jak urok! –