influxdb/cmd/influx_inspect
Jonathan A. Sternberg 0b7c56bcd8 Update the zap logger dependency
The previous sha was taken from a revision on a devel branch that I
thought would continue staying in the tree after it was merged. That
revision was rebased away and the API was changed for the logger.

This updates the usage of the logger and adds a simple package for
constructing the base logger.

The 1.0 version of zap changed the format of the default console logger
so this change moves over to this new logger instead of attempting to
retain backwards compatibility with the old format.
2017-11-10 16:27:16 -06:00
..
dumptsi Handle nil MeasurementIterator. 2017-10-26 11:25:46 -06:00
dumptsm Update influx inspect to support unsigned types 2017-10-05 10:26:14 -05:00
export influxdata/influxdb/influxql -> influxdata/influxql 2017-10-30 14:40:26 -07:00
help TSI Index Migration 2017-08-15 11:40:24 -06:00
inmem2tsi Update the zap logger dependency 2017-11-10 16:27:16 -06:00
report Add time range summary 2017-10-09 14:35:30 -06:00
verify Add block type for BlockIterator 2017-03-09 09:16:59 -07:00
README.md Update example in influx_inspect README.md 2016-11-01 10:16:23 -07:00
main.go TSI Index Migration 2017-08-15 11:40:24 -06:00

README.md

influx_inspect

Ways to run

influx_inspect

Will print usage for the tool.

influx_inspect report

Displays series meta-data for all shards. Default location [$HOME/.influxdb]

influx_inspect dumptsm

Dumps low-level details about tsm1 files

Flags

-index bool

Dump raw index data.

default = false

-blocks bool

Dump raw block data.

default = false

-all

Dump all data. Caution: This may print a lot of information.

default = false

-filter-key

Only display index and block data match this key substring.

default = ""

influx_inspect export

Exports all tsm files to line protocol. This output file can be imported via the influx command.

-datadir string

Data storage path.

default = "$HOME/.influxdb/data"

-waldir string

WAL storage path.

default = "$HOME/.influxdb/wal"

-out string

Destination file to export to

default = "$HOME/.influxdb/export"

-database string (optional)

Database to export.

default = ""

-retention string (optional)

Retention policy to export.

default = ""

-start string (optional)

Optional. The time range to start at.

-end string (optional)

Optional. The time range to end at.

-compress bool (optional)

Compress the output.

default = false

Sample Commands

Export entire database and compress output:

influx_inspect export --compress

Export specific retention policy:

influx_inspect export --database mydb --retention autogen
Sample Data

This is a sample of what the output will look like.

# DDL
CREATE DATABASE MY_DB_NAME
CREATE RETENTION POLICY autogen ON MY_DB_NAME DURATION inf REPLICATION 1

# DML
# CONTEXT-DATABASE:MY_DB_NAME
# CONTEXT-RETENTION-POLICY:autogen
randset value=97.9296104805 1439856000000000000
randset value=25.3849066842 1439856100000000000

Caveats

The system does not have access to the meta store when exporting TSM shards. As such, it always creates the retention policy with infinite duration and replication factor of 1. End users may want to change this prior to re-importing if they are importing to a cluster or want a different duration for retention.