I want to add the in_usage and out_usage value from the below table.
for example, I want to add in_usage with out_usage and result should be as total. Likewise for other values. can someone give ideas for this.
_time | source | status | Avg | metric_name |
11/3/2021 5:02 | Interface_Summary_Out | out_usage | 16.01833333 | GigabitEthernet0/1 |
11/3/2021 5:00 | Interface_Summary_In | in_usage | 5.555 | GigabitEthernet0/1 |
11/3/2021 4:02 | Interface_Summary_Out | out_usage | 17.085 | GigabitEthernet0/1 |
11/3/2021 4:00 | Interface_Summary_In | in_usage | 5.270833333 | GigabitEthernet0/1 |
11/3/2021 3:02 | Interface_Summary_Out | out_usage | 17.425 | GigabitEthernet0/1 |
11/3/2021 3:00 | Interface_Summary_In | in_usage | 5.48 | GigabitEthernet0/1 |
Please refer the attached screenshot for you reference
Thank you. It worked. I have different hostname and metric_name. So i have added host and metric_name at the end
| bin _time span=1h
| stats sum(Avg) as total by _time host metric_name
| bin _time span=1h
| stats sum(Avg) as total by _time