I have CPU Utilization data ingested into Elastic Search. My requirement is to calculate distance between 2 subsequent values e.g. current value and previous value. Please provide any pointers to achieve the same using script Query in Elastic Search.
Below is the snapshot of sample data ingested into ES. Currently I have single server with single metric only.
What do you want to do with this distance? You should probably compute that distance on the client side before sending the data to Elasticsearch. Once documents are in Elasticsearch, the order of documents does not mean much, Elasticsearch actually freely reorders documents if it allows for more efficient merges.
Thanks for the response. I cannot do processing on the client side due to some restrictions.
I have metric_time field stored in ES which can be used to get current and previous value but I am not getting any pointers how to achieve the same in query in ES. Pls let me know if you need more info on the requirements.
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.