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 | 44 ++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/tools/etcd-dump-logs/README.md b/tools/etcd-dump-logs/README.md index 12fed8f5e..b6edc3021 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,10 +65,32 @@ 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_correctoutputformat.sh /tmp/datadir +Snapshot: +empty +Start dupmping log entries from snapshot. +WAL metadata: +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 +Entry types () count is : 8 +``` + ``` $ etcd-dump-logs -stream-decoder decoder_wrongoutputformat.sh /tmp/datadir Snapshot: @@ -89,24 +111,6 @@ term index type data decoder_status decoded_data 27 8 norm ??? decoder output format is not right, print output anyway cf Entry types () count is : 8 -$ etcd-dump-logs -stream-decoder decoder_wrongoutputformat.sh /tmp/datadir -Snapshot: -empty -Start dupmping log entries from snapshot. -WAL metadata: -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 -Entry types () count is : 8 ``` #### etcd-dump-logs -start-index [data dir]