From 7e0ae96c6aaa9d56ee7b313e475ce4f4e3a0895c Mon Sep 17 00:00:00 2001 From: Wenjia Zhang Date: Tue, 19 Jun 2018 15:37:04 -0700 Subject: [PATCH] etcd-dump-logs: minor editting in README.md --- tools/etcd-dump-logs/README.md | 42 +++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/tools/etcd-dump-logs/README.md b/tools/etcd-dump-logs/README.md index 12fed8f5ef8..b6edc302134 100644 --- a/tools/etcd-dump-logs/README.md +++ b/tools/etcd-dump-logs/README.md @@ -30,7 +30,7 @@ Flags: ``` #### etcd-dump-logs -entry-type [data dir] -Lists all the interested entries from WAL log. +Filter entries by type from WAL log. ``` $ etcd-dump-logs -entry-type IRRTxn /tmp/datadir @@ -65,12 +65,13 @@ Entry types (ConfigChange,IRRCompaction) count is : 5 ``` #### etcd-dump-logs -stream-decoder [data dir] -Decode each entry based on logic in the passed decoder. Decoded status and decoded data are listed in separated tab/columns in the ouput. For parsing purpose, the output from decoder are expected to be in format of "||". Please refer to [decoder_correctoutputformat.sh] as an example. However, if the decoder output format is not as expected, "decoder_status" will be "decoder output format is not right, print output anyway", and all output from decoder will be considered as "decoded_data" + ``` -$ etcd-dump-logs -stream-decoder decoder_wrongoutputformat.sh /tmp/datadir +$ etcd-dump-logs -stream-decoder decoder_correctoutputformat.sh /tmp/datadir Snapshot: empty Start dupmping log entries from snapshot. @@ -79,16 +80,18 @@ nodeID=0 clusterID=0 term=0 commitIndex=0 vote=0 WAL entries: lastIndex=34 term index type data decoder_status decoded_data - 1 1 conf method=ConfChangeAddNode id=2 decoder output format is not right, print output anyway jhjaajjjahjbbbjj - 3 2 norm noop decoder output format is not right, print output anyway jhjjabjjaajfbfgjfagdfhcjbbahgbbbfhfegibbcabbfhffbbbcbbfhfibbcaebbbgiffbbedgdbhjacbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj - 3 3 norm method=QGET path="/path1" decoder output format is not right, print output anyway jhjaabjdeadgdeedaajfbfgjfagdfhcabbacgbbbcjbbcabbcabbbcbbcbbbcaebbbccbbedgdbhjjcbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj - 7 4 norm ID:8 txn: > failure: > > decoder output format is not right, print output anyway jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb - 8 5 norm ID:9 compaction: decoder output format is not right, print output anyway jhjicajbajja - 9 6 norm ID:10 lease_grant: decoder output format is not right, print output anyway jhjadbjdjhjaajja - 12 7 norm ID:13 auth_enable:<> decoder output format is not right, print output anyway jhjdcbcejj - 27 8 norm ??? decoder output format is not right, print output anyway cf + 1 1 conf method=ConfChangeAddNode id=2 ERROR jhjaajjjahjbbbjj + 3 2 norm noop OK jhjjabjjaajfbfgjfagdfhcjbbahgbbbfhfegibbcabbfhffbbbcbbfhfibbcaebbbgiffbbedgdbhjacbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj + 3 3 norm method=QGET path="/path1" OK jhjaabjdeadgdeedaajfbfgjfagdfhcabbacgbbbcjbbcabbcabbbcbbcbbbcaebbbccbbedgdbhjjcbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj + 7 4 norm ID:8 txn: > failure: > > OK jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb + 8 5 norm ID:9 compaction: ERROR jhjicajbajja + 9 6 norm ID:10 lease_grant: ERROR jhjadbjdjhjaajja + 12 7 norm ID:13 auth_enable:<> ERROR jhjdcbcejj + 27 8 norm ??? ERROR cf Entry types () count is : 8 +``` +``` $ etcd-dump-logs -stream-decoder decoder_wrongoutputformat.sh /tmp/datadir Snapshot: empty @@ -98,15 +101,16 @@ nodeID=0 clusterID=0 term=0 commitIndex=0 vote=0 WAL entries: lastIndex=34 term index type data decoder_status decoded_data - 1 1 conf method=ConfChangeAddNode id=2 ERROR jhjaajjjahjbbbjj - 3 2 norm noop OK jhjjabjjaajfbfgjfagdfhcjbbahgbbbfhfegibbcabbfhffbbbcbbfhfibbcaebbbgiffbbedgdbhjacbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj - 3 3 norm method=QGET path="/path1" OK jhjaabjdeadgdeedaajfbfgjfagdfhcabbacgbbbcjbbcabbcabbbcbbcbbbcaebbbccbbedgdbhjjcbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj - 7 4 norm ID:8 txn: > failure: > > OK jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb - 8 5 norm ID:9 compaction: ERROR jhjicajbajja - 9 6 norm ID:10 lease_grant: ERROR jhjadbjdjhjaajja - 12 7 norm ID:13 auth_enable:<> ERROR jhjdcbcejj - 27 8 norm ??? ERROR cf + 1 1 conf method=ConfChangeAddNode id=2 decoder output format is not right, print output anyway jhjaajjjahjbbbjj + 3 2 norm noop decoder output format is not right, print output anyway jhjjabjjaajfbfgjfagdfhcjbbahgbbbfhfegibbcabbfhffbbbcbbfhfibbcaebbbgiffbbedgdbhjacbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj + 3 3 norm method=QGET path="/path1" decoder output format is not right, print output anyway jhjaabjdeadgdeedaajfbfgjfagdfhcabbacgbbbcjbbcabbcabbbcbbcbbbcaebbbccbbedgdbhjjcbjjchjjdjjjdhjiejjjehjafjjjfhjjgjjjghjahjjajjhhjajj + 7 4 norm ID:8 txn: > failure: > > decoder output format is not right, print output anyway jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb + 8 5 norm ID:9 compaction: decoder output format is not right, print output anyway jhjicajbajja + 9 6 norm ID:10 lease_grant: decoder output format is not right, print output anyway jhjadbjdjhjaajja + 12 7 norm ID:13 auth_enable:<> decoder output format is not right, print output anyway jhjdcbcejj + 27 8 norm ??? decoder output format is not right, print output anyway cf Entry types () count is : 8 + ``` #### etcd-dump-logs -start-index [data dir]