dmexport - exports records from database to file
dmexport --help
dmexport --version
dmexport --database file --type type --format format --node id [--output file] [--sensor id] [--target id] [--response name] [--from timestamp] [--to timestamp] [--header] [--separator char]
The dmexport program writes logs, nodes, sensors, targets, and observations from database to file, in ASCII block, CSV, JSON, or JSON Lines format. The ASCII block data format is only available for X/Y data points.
The types data point, log, and observation require a given sensor id, target id, and time range in ISO 8601 format.
If no output file is given, the data is printed to standard output. The output file will be overwritten if it already exists. If no records are found, an empty file will be created.
- --database, -d file
-
Path of the SQLite database (required).
- --format, -f [block|csv|json|jsonl]
-
Output file format, either ASCII block, CSV, JSON, JSON Lines (required). Only data points can be exported in block format.
- --from, -B timestamp
-
Start of time range in ISO 8601 (required for types
db
,log
,observ
). - --header, -H
-
Enable CSV header.
- --help, -h
-
Output available command-line arguments and quit.
- --node, -N id
-
Node id (required).
- --output, -o file
-
Path of output file. Empty or
-
for standard output. - --response, -R name
-
Response name (required for type
dp
). - --sensor, -S id
-
Sensor id (required for types
dp
andobserv
). - --separator, -s char
-
Single character used as separator instead of comma.
- --target, -T id
-
Target id (required for type
dp
andobserv
). - --to, -E timestamp
-
End of time range in ISO 8601 (required for types
dp
,log
, andobserv
). - --type, -t [beat|dp|log|node|observ|sensor|target]
-
Type of records to export (required).
- --version, -v
-
Output version information and quit.
Export log messages from database to JSON file:
$ dmexport --database log.sqlite --type log --format json --node dummy-node \ --from 2020-01-01 --to 2025-01-01 --output /tmp/log.json
Export observations from database to CSV file:
$ dmexport --database observ.sqlite --type observ --format csv --node dummy-node \ --sensor dummy-sensor --target dummy-target --from 2020-01-01 --to 2025-01-01 \ --output /tmp/observ.csv
Project web site: https://www.dabamos.de/