junegunn / redis-stat

(UNMAINTAINED) A real-time Redis monitoring tool
MIT License
2.02k stars 339 forks source link

Gather logs to different csv files in different time intervals... #43

Closed prh7 closed 8 years ago

prh7 commented 8 years ago

Presently with redis-stat, it can generates log data regarding key performance indicators of redis-cluster and stash the logs into the single specified .csv file by the --csv command. Usecase: I wanted to stash the generated logs into different .csv files in different time intervals. Lets say for example: we have 24 hours in a day and we divide the day into 4 different time intervals comprising of 6 hours each.

  1. For first time interval, all the generated logs are getting stashed into log1.csv file and at the end of first time interval, log1.csv stop storing the logs and passes the storage operation of logs to next .csv file which we can create automatically through a script program.
  2. For second time interval, all the generated logs are now getting stashed into log2.csv file and at the end of second time interval, log2.csv stop storing the logs and passes the storage operation of logs to next .csv file which we can create automatically through a script program. The process carry so on this way. Is this monitoring tool having this kind of configuration or is there also any other way to do it? Any help would be highly apprecialble.
junegunn commented 8 years ago

If --csv option is specified without the file name, the lines will be printed to the standard output, so you easily can write a custom filter that processes the output as you wish.

redis-stat --csv | your-custom-log-processing-script

FYI, I sometimes use this script to rotate log files. Anyway I think you got the point.