I'm working on a requirement where I'll have to create a dashboard that shows the Inbound traffic (in percentage) of each interface in the network.
I have the fields 'system.network.in.bytes' having the inbound traffic value in bytes and 'system.network.name' having values like Ethernet or Ethernet2 or Ethernet5 etc.,
I want to calculate the Total sum of system.network.in.bytes and the sum of system.network.in.bytes of each value in the system.network.name field and then to calculate the percentage traffic of each network.
For example: (Total In bytes of Ethernet2 / Total In bytes) * 100
I tried bucket script and filter ratio in TSVB but it is not giving the expected result.
Please help me to make it work. Thanks in advance.
For percentange calculation, I'll have to calculate Total sum of system.network.in.bytes and the sum of system.network.in.bytes of each system.network.name.
In enhanced data table, if I split the rows by system.network.name, I will get the sum of system.network.in.bytes of each network name but I will miss the total sum. If so, then I cannot calculate the percentange.
I'm not sure how it can be achieved using scripted fields. Could you please give me some idea of how to use scripted field in this scenario?
Hi @subash,
You can use a painless script to generate a new field having the calculated value in percentage and then use that field in the kibana dashboard.
Sorry, I forgot to mention this in the post.
The sum and percentage calculation are based on the selected time range. If the user selects last 15 minutes in the time picker then we'll have to do percentage calculation with the data of last 15 mins.
@subash ,
You would have to use the time filter in top of dashboard and once the required the time range is selected then the calculation would be based on that time range only and the result will be displayed accordingly in your dashboard for that particular generated field.
Thanks
I have no idea of how to use the painless script for generating a new field that stores the calculated value. Could you please help me with a sample code snippet, if any?
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.