DataStax Help Center

Command to sum up cfstats data across nodes

Sometimes it's useful to sum up cfstats data across nodes. For example, space used, number of keys, etc. The following command will do it assuming you have cfstats-nodename.txt files from each node in a single directory:

cat cfstats*.txt | grep -A18 "Audit_Log" | grep "SSTable count" | cut -d: -f2 | awk '{total += $1} END {print total}'

This should work for any other metric or column family you are interested in.  Change the CF name in the first grep and the metric name in the second grep.  

This command is written against the cfstats output for C* 1.1. For other versions that output a different number of metrics per column family, you'd need to change the -A parameter passed to the first grep.

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk