fgeller / kt

Kafka command line tool that likes JSON
MIT License
950 stars 100 forks source link

Feature request: Support parsing value as json #124

Closed shanavas786 closed 3 years ago

shanavas786 commented 3 years ago

If the topic has json data, say

{"a": "b"}

the consumer output is

{"partition":0,"offset":0,"key":null,"value":"{\"a\":\"b\"}","timetamp":...}

It would be great if consumer can print

{"partition":0,"offset":0,"key":null,"value":{"a":"b"},"timetamp":...}
fgeller commented 3 years ago

Hi @shanavas786, for that use case I recommend using a tool like jq I always use kt together with jq ;) It allows you to interpret the value as a JSON string, cf. this question on stack overflow.

fgeller commented 3 years ago

Closing the issue as out of scope.