I'm trying to find the distance between two geo coordinates and am looking for help with the search syntax.Here's what my data looks like
Index=S1 created from Sensor1.csv has Id,Lat1,Long1 and Index=S2 created from Sensor2.csv has Id,Lat2,Long2 . I need to find all Lat2 and Long2 that are within a certain distance (say 1 mile) of Lat1 and Long1. I'm ok to do something like the calculation below because I'm working in a small area and reasonable accuracy will work ..is the search syntax below correct?
index=S1 or index=S2 | eval distance=sqrt(pow(Lat1-Lat2,2)+pow(Long1-Long2,2)) ....
How would I use the Haversine formula (assuming I convert my lat long to the required x,y format that Haversine needs)
How do I use the calculated distance in my search syntax. Thanks