Hello All,
I use Kibana version 7.15.2.
I'm not able to perform TopHits or last value metrics aggregation on runtime fields. I just see blanks or dashes '-' when I do so.
Here is an example:
On the kibana_sample_data_logs index, I create an index pattern with a runtime field of type long to calculate the square of the bytes field. The name of this field is Bytes power 2
Here is my runtime field script :
emit(doc['bytes'].value*doc['bytes'].value);
In a lens table, I try to find the last value of bytesSquare for top agent.name and I don't get expected results:
Try filtering the lens metrics for where your runtime field has a value. sometimes the nulls can trip up the last value operation. So much so that we add this metric filter by default in version 8.2
Also I've modified runtime field script so as to never return null by emitting 0 whenever bytes field doesn't exist or is empty.. and I still get dashes when calculating last value or TopHits
This is the modified script :
if (!doc.containsKey('bytes') || doc['bytes'].empty) { emit(0); } else emit(doc['bytes'].value*doc['bytes'].value);
Thanks Graham. I just checked with version 7.17.2 and it seems to be working fine there. Is this a bug or limitation in 7.15.2? Is there a workaround to get this working in 7.15.2?
I checked and we don't normally backport to older releases on the same major version unless it's very serious (like a security issue). If you can upgrade to 7.17.x then that's the recommended solution. if you are unable to upgrade you could also try the legacy data table visualization as an alternative.
Thanks Graham!
Legacy data tables in 7.15.2 also have same problem.
Thanks for the assistance. Now I know that upgrade to 7.17.x is the only way to make it work.
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.