Vehicle tracking through coordinate map

Hey guys,

So my gratuation project is to monitor a vehicle through IoT technology. I got all the sensors working sending data to logstash and ultimately visualizing it through graphs in Kibana.

Now my goal is to track the vehicle using coordinate maps in Kibana. To do that I started by having logstash read from a file wich is being updated by a python script with some coordinates to simulate movement. Logstash then output to a Elasticsearch index that has a geopoint field to receive the coordinates.

Now the issue that I'm having is that I can't seem to find a way to show only that last location of the vehicle in a way where I would see the point moving in the map. The only way that I got it to work was setting the time range to last 5 seconds, so any aggregation would be unique and the coordinate bucket would only have a single value, if I understood it correctly.

What I'm looking for is a way for me to visualize a single point with the last coordinates sent where the time range would not be only last 5 seconds, since I'll have other graphs that won't work with that time range.

I don't know if I made my self very clear. I hope someone could help me figuring it out.

Thanks in advance!

You should be able to bucket by vehicle, then use the top_hits aggregation to select only the most recent location per vehicle. https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-top-hits-aggregation.html

Hope this helps.

Huum, I think I get the idea but I don't get how do I do that from Kibana's visualization screen.

When I open the coordinate maps visualization I have a section for Metrics and a section for Buckets. The Metrics section gives me the Top hit option for number field not for a geopoint field.
Then the Buckets section is locked on Geo Coordinates and only gives me geohash as aggregation option and the geopoint fields as field options.

the top_hits that u mention is used on a customized query somehow?

So I have tried to accomplish this with a geo visualization and not been successful. I can do the right bucketing and top hit picking with other visualization types, but not geo. I think this would require another visualization type in Kibana. You could consider filing an issue, or you could have a go at creating a plugin to supply this.

This might be an option - Route on map

Thanks for the feedback guys. For now I settled by opening two Kibana screens with different time ranges so I can watch the graphs on one screen and the map on the other screen with 5 seconds time range.

What I was looking into was the filtering option for the visualization. If I have the time range on the toolbar setted on 15 minutes and add a filter on @timestamp setting it to "now-5s" shouldn't it work for what I'm trying to accomplish (watching only the last 5 seconds entries)?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.