I'm facing an issue when trying to visualize the output of nodetool cfstats
as a table.
My command is as follows
nodetool cfstats telemetry -H | awk -F ' *: *' ' BEGIN { print "Keyspace,Table,Mean,Live,Total" } /^Keyspace : / { ks = $2 } /\tTable:/ { t = $2 } /\t\tCompacted partition mean bytes:/ { mp = $2 } /\tSpace used .live/ { sp = $2 } /\tSpace used .total/ { print ks "," t "," mp "," sp "," sp } ' | column -s , -t
Output:
Keyspace | Table | Mean | Live | Total |
---|---|---|---|---|
telemetry | crash_callstack_relations | 0 bytes | 0 bytes | |
telemetry | crash_issues | 0 | 0 bytes | 0 bytes |
telemetry | crash_log_events | 0 | 6.39 KiB | 6.39 KiB |
telemetry | crash_log_events_count | 2759 | 0 bytes | 0 bytes |
telemetry | crashes_by_counts | 0 | 0 bytes | 0 bytes |
As you can see there are two shifts has happened in the result. One in the first row and the other one in the Mean column. In the first row the Mean value is missing therefore next two values has shifted to the left by one cell. Also the Mean value of the crash_log_events
has moved one cell down. I tried different ways to fix this but could find a correct solution. It's great if someone can help me to figure out this. Thanks in advance.