Hey Folks,
I'm struggling to sum the value in record (bytes) and visualize it in table. Any idea how would i achieve the SUM and converted to GB?
Hey Folks,
I'm struggling to sum the value in record (bytes) and visualize it in table. Any idea how would i achieve the SUM and converted to GB?
You can't sum
keyword fields, they need to be a numeric mapping. You can either re-map the field as a number, or you can use a runtime field to make a temporary copy of the keyword field to use as a number field. Sum aggregation | Elasticsearch Guide [8.6] | Elastic provides somewhat of an example of using a runtime field. Note: this method will be slower than using a natively mapped number field.
Hello @maskrider1111
Use TSVB option instead of Lens, In TSVB u can choose Options and drop down menu under Data Formatter will be having Bytes. and in parallel column, you can divide or multiply to create GBs/MBs/ or TBs as per requirement
@maskrider1111 what's the field type for the sentbyte
and rcvdbyte
? It looks like they are mapped as strings/keywords.
Perhaps a solution I could suggest is to create two runtime field
for each of the two, when values are parsed as double
(or any numeric type) and then apply a Sum
operation in Lens.
The content of the runtime field can be the following:
if(!doc['sentbytes'].isEmpty()){
emit(Integer.parseInt((doc['sentbytes'].value)))
}
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
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.