Skip to content

Commit

Permalink
Merge pull request etcd-io#9868 from wenjiaswe/minorchange
Browse files Browse the repository at this point in the history
etcd-dump-logs: minor editting in README.md
  • Loading branch information
gyuho authored Jun 19, 2018
2 parents 897c055 + 7e0ae96 commit 82db651
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions tools/etcd-dump-logs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Flags:
```
#### etcd-dump-logs -entry-type <ENTRY_TYPE_NAME(S)> [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
Expand Down Expand Up @@ -65,12 +65,13 @@ Entry types (ConfigChange,IRRCompaction) count is : 5
```
#### etcd-dump-logs -stream-decoder <EXECUTABLE_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 "<DECODING_STATUS>|<DECODED_DATA". Please refer to [decoder_correctoutputformat.sh] as an example.
Decode each entry based on logic in the passed decoder. Decoder 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 "<DECODER_STATUS>|<DECODED_DATA>". 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.
Expand All @@ -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:<success:<request_delete_range:<key:"a" range_end:"b" > > failure:<request_delete_range:<key:"a" range_end:"b" > > > decoder output format is not right, print output anyway jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb
8 5 norm ID:9 compaction:<physical:true > decoder output format is not right, print output anyway jhjicajbajja
9 6 norm ID:10 lease_grant:<TTL:1 ID:1 > 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:<success:<request_delete_range:<key:"a" range_end:"b" > > failure:<request_delete_range:<key:"a" range_end:"b" > > > OK jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb
8 5 norm ID:9 compaction:<physical:true > ERROR jhjicajbajja
9 6 norm ID:10 lease_grant:<TTL:1 ID:1 > 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
Expand All @@ -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:<success:<request_delete_range:<key:"a" range_end:"b" > > failure:<request_delete_range:<key:"a" range_end:"b" > > > OK jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb
8 5 norm ID:9 compaction:<physical:true > ERROR jhjicajbajja
9 6 norm ID:10 lease_grant:<TTL:1 ID:1 > 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:<success:<request_delete_range:<key:"a" range_end:"b" > > failure:<request_delete_range:<key:"a" range_end:"b" > > > decoder output format is not right, print output anyway jhjhcbadabjhaajfjajafaabjafbaajhaajfjajafaabjafb
8 5 norm ID:9 compaction:<physical:true > decoder output format is not right, print output anyway jhjicajbajja
9 6 norm ID:10 lease_grant:<TTL:1 ID:1 > 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 <INDEX NUMBER> [data dir]

Expand Down

0 comments on commit 82db651

Please sign in to comment.