Can we get cbq output in csv format

I presume that’s a question rather than a request, so no, the output from cbq is the same as you get from the server’s REST endpoint as it isn’t an export tool, rather it is a general-purpose query execution tool and as such CSV wouldn’t be appropriate.

(If it is a request then I think it would be more appropriate to ask for cbexport to support CSV format and queries - https://issues.couchbase.com/browse/MB-43733).

You can however process the JSON output to produce CSV with tooling such as “jq” as covered here, for example: bash - Using jq to extract values and format in CSV - Unix & Linux Stack Exchange

HTH.

1 Like