apache / apache/bookkeeper

Bookkeeper CLI output format

Open
#4,624 0 comments 0 reactions 0 assignees View on GitHub
type/question
Dominant language
Java
Stars
2k
Forks
976
Avg merge
6d 15h
Merged PRs (30d)
7

Description

**QUESTION**

Hello,

I'd like to change the format of the data returned by the CLI, particularly the Bookkeeper Shell.

Currently, everything goes through the logs.

Would it be possible to define a more usable format like the API with JSON output ?

Exemple :

* currently :
* log4j2-bkcli.xml :
```xml


ERROR
CONSOLE


















```
* command :
```
$ BOOKIE_LOG_CONF=conf/log4j2-bkcli.xml bin/bookkeeper shell listbookies -a
```
* result :
```
All Bookies :
BookieID:eda-pulsar-helm-chart-bookie-1.eda-pulsar-helm-chart-bookie.n-eda-d.svc.cluster.local:3181, IP:10.125.32.9, Port:3181, Hostname:eda-pulsar-helm-chart-bookie-1.eda-pulsar-helm-chart-bookie.n-eda-d.svc.cluster.local
BookieID:eda-pulsar-helm-chart-bookie-0.eda-pulsar-helm-chart-bookie.n-eda-d.svc.cluster.local:3181, IP:10.125.33.90, Port:3181, Hostname:eda-pulsar-helm-chart-bookie-0.eda-pulsar-helm-chart-bookie.n-eda-d.svc.cluster.local
BookieID:eda-pulsar-helm-chart-bookie-2.eda-pulsar-helm-chart-bookie.n-eda-d.svc.cluster.local:3181, IP:10.125.34.20, Port:3181, Hostname:eda-pulsar-helm-chart-bookie-2.eda-pulsar-helm-chart-bookie.n-eda-d.svc.cluster.local
```

* with output format :
* command :
```
$ BOOKIE_LOG_CONF=conf/log4j2-bkcli.xml bin/bookkeeper shell listbookies -a --output json
```
* result :
```json
{
"eda-pulsar-helm-chart-bookie-1.eda-pulsar-helm-chart-bookie.n-eda-d.svc.cluster.local:3181" : null,
"eda-pulsar-helm-chart-bookie-0.eda-pulsar-helm-chart-bookie.n-eda-d.svc.cluster.local:3181" : null,
"eda-pulsar-helm-chart-bookie-2.eda-pulsar-helm-chart-bookie.n-eda-d.svc.cluster.local:3181" : null
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.