I need your expert advice to get the below output
INPUT
2020-01-09 15:39:39,sharm,07296,97
2020-01-09 15:40:40,SRI,6657,197
2020-01-09 15:42:40,rinku,null,0
2020-01-09 15:42:40,SVRMO,8588,39
2020-01-09 15:44:58,MASTA,093720,48
here, fetch the last 5 min data. Assuming the command is run at 15:45, data from (15:40-15:45) should be selected.
2020-01-09 15:40:40,SRI,6657,197
2020-01-09 15:42:40,rinku,null,0
2020-01-09 15:42:40,SVRMO,8588,39
2020-01-09 15:44:58,MASTA,093720,48
The output should be
284,4,3
Where
- 284 show sum of last row data (197+0+39+48)
- 4 show total count of data in last 5 min
- 3 show total count of data where last column value is not 0 (in the example: lines 1,3, and 4 where the value is 197,39, and 48, respectively)