Hi there, this is a case for TSVB bucket scripting. Here's the similar (bur reverse) example. In kibana_sample_data_flight we have available Distance field so I am gonna calculate average speed per hour:
In your case the script will be something like params.averageSpeed * (params._interval/1000/60/60)
The params._interval is passed as ms so we need to convert it to an hour with /1000/60/60 or just 3600000.
Thank you very much @Marta_Bondyra for your Help!
It was really helpful and i took some time to fiddle with the TSVB hence i reply this late.
I have one more "Problem", that you might have a answer to.
My Data is from a Flight Tracker Website (CSV) and the Airplane in Question is not tracked 100% of the Flight. Most of the Time i get the Takeoff and Landing within the Data but missing on several hours of the Flight.
To get the Total Flighttime i am thinking of somehow extracting the first and last Entry in the CSV and calculate the "Total Time".
My approach would be either:
Scriped Processor within a Pipeline
Runtime Field
Your approach is totally working, no doubt, but for my missing Data it gives me trouble.
1h Interval --> Average Speed = Distance Traveld
Cumulative Sum of Dinstance remains zero if no metrics are recieved.
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.