File Export
The file-export command reads data from a Redis database and writes it to a file, potentially gzip-compressed.
Supported File Types
| Type | Extension | Description |
|---|---|---|
|
|
Comma-separated values |
|
|
Tab-separated values |
|
|
Pipe-separated values |
|
|
JSON array |
|
|
JSON Lines (newline-delimited JSON) |
|
|
XML |
|
|
Apache Parquet |
The general usage is:
riotx file-export [OPTIONS] FILE
To show the full usage, run:
riotx file-export --help
JSON
Export to JSON
riotx file-export myexport.json
Sample JSON-export file
[
{"key":"gen:71","event":"scan","time":"2024-11-06T08:23:12.559Z","type":"json","value":"{\"field1\":\"value1\",\"field2\":\"value2\"}"},
{"key":"gen:83","event":"scan","time":"2024-11-06T08:23:12.559Z","type":"hash","value":{"field1":"value1","field2":"value2"}},
{"key":"gen:45","event":"scan","time":"2024-11-06T08:23:12.559Z","type":"set","value":["1","2","3"]}
]
Export to compressed JSON
riotx file-export myexport.json.gz
JSON Lines
JSON Lines (also known as newline-delimited JSON) outputs each record on a separate line without the array wrapper.
Use the .jsonl extension or specify --type jsonl.
Export to JSON Lines
riotx file-export myexport.jsonl
Sample JSON Lines export file
{"key":"gen:71","event":"scan","time":"2024-11-06T08:23:12.559Z","type":"json","value":"{\"field1\":\"value1\",\"field2\":\"value2\"}"}
{"key":"gen:83","event":"scan","time":"2024-11-06T08:23:12.559Z","type":"hash","value":{"field1":"value1","field2":"value2"}}
{"key":"gen:45","event":"scan","time":"2024-11-06T08:23:12.559Z","type":"set","value":["1","2","3"]}
CSV
Export to comma-separated values format.
Export to CSV
riotx file-export myexport.csv --content-type MAP
TSV (Tab-Separated Values)
Export to tab-separated values format.
Use the .tsv extension or specify --type tsv.
Export to TSV
riotx file-export myexport.tsv --content-type MAP