Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to output to file from cassandra client?

Tags:

cassandra

I want to save result of list command into file. How can I do it from cassandra-cli?

like image 721
Oleg Razgulyaev Avatar asked Oct 21 '12 12:10

Oleg Razgulyaev


People also ask

How do I export Cassandra data to CSV?

Right click on the output and select "Copy All as CSV" to paste the output in CSV.

What is Cqlsh command?

cqlsh is a command-line interface for interacting with Cassandra using CQL (the Cassandra Query Language). It is shipped with every Cassandra package, and can be found in the bin/ directory alongside the cassandra executable.


1 Answers

Save the commands you'd type into a file to be used as a script, then invoke cli:

cassandra-cli <commands.txt >listing.txt
like image 185
Chris Gerken Avatar answered Sep 30 '22 19:09

Chris Gerken