What to put in logstash config if ther is null for lat & long?
Some rows do not have gps_long nor gps_lat coordinates. SQL input returns NULL.
But null is rejected by logstash or ES.
My logstash config:
Some rows contains geo coordinates, some not. I do not know which ones are empty. So I cannot remove those fields (I need them). Temp solution is to put '0.0' but this generate wrong coordinate. Null seems to be logical solution but for some reason coder disabled that.
You can check for the existence of a specific field, but there’s currently no way to differentiate between a field that doesn’t exist versus a field that’s simply false. The expression `if [foo]` returns `false` when:
* `[foo]` doesn’t exist in the event,
* `[foo]` exists in the event, but is false, or
* `[foo]` exists in the event, but is null
So, there is no way to determine if field contain NULL or not. I made a workaround modifying SQL so it returns 'null' string if null in table and removing geo_point field in Logstash filter when it contains string 'null'.
Thanks for help
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.