Skip to content

Instantly share code, notes, and snippets.

@zshamrock
Last active December 2, 2016 14:09
Show Gist options
  • Save zshamrock/62ad29b76a314106922790309aa4639c to your computer and use it in GitHub Desktop.
Save zshamrock/62ad29b76a314106922790309aa4639c to your computer and use it in GitHub Desktop.
InfluxDB CLI Walk Through
##### connect
$ ./influxdb-cli.sh
Connected to http://localhost:8086 version 1.1.0
InfluxDB shell version: 1.1.0
##### help
> help
Usage:
 connect <host:port> connects to another node specified by host:port
 auth prompts for username and password
 pretty toggles pretty print for the json format
 use <db_name> sets current database
 format <format> specifies the format of the server responses: json, csv, or column
 precision <format> specifies the format of the timestamp: rfc3339, h, m, s, ms, u or ns
 consistency <level> sets write consistency level: any, one, quorum, or all
 history displays command history
 settings outputs the current settings for the shell
 exit/quit/ctrl+d quits the influx shell
show databases show database names
 show series show series information
 show measurements show measurement information
 show tag keys show tag key information
 show field keys show field key information
A full list of influxql commands can be found at:
 https://docs.influxdata.com/influxdb/latest/query_language/spec/
##### show databases
> show databases
name: databases
name
 — — 
telegraf
_internal
##### use
> use telegraf
Using database telegraf
##### show measurements
> show measurements
name: measurements
name
 — — 
cpu
disk
diskio
docker
kernel
mem
mongodb
processes
rabbitmq_node
rabbitmq_overview
rabbitmq_queue
swap
system
##### show field keys
# Only keys for `mongodb` and `rabbimq` are showed:
> show field keys
...
name: mongodb
fieldKey fieldType
 — — — — — — — — -
active_reads integer
active_writes integer
commands_per_sec integer
deletes_per_sec integer
flushes_per_sec integer
getmores_per_sec integer
inserts_per_sec integer
jumbo_chunks integer
member_status string
net_in_bytes integer
net_out_bytes integer
open_connections integer
percent_cache_dirty float
percent_cache_used float
queries_per_sec integer
queued_reads integer
queued_writes integer
repl_commands_per_sec integer
repl_deletes_per_sec integer
repl_getmores_per_sec integer
repl_inserts_per_sec integer
repl_lag integer
repl_queries_per_sec integer
repl_updates_per_sec integer
resident_megabytes integer
ttl_deletes_per_sec integer
ttl_passes_per_sec integer
updates_per_sec integer
vsize_megabytes integer
name: rabbitmq_node
fieldKey fieldType
 — — — — — — — — -
disk_free integer
disk_free_limit integer
fd_total integer
fd_used integer
mem_limit integer
mem_used integer
proc_total integer
proc_used integer
run_queue integer
sockets_total integer
sockets_used integer
name: rabbitmq_overview
fieldKey fieldType
 — — — — — — — — -
channels integer
connections integer
consumers integer
exchanges integer
messages integer
messages_acked integer
messages_delivered integer
messages_published integer
messages_ready integer
messages_unacked integer
queues integer
name: rabbitmq_queue
fieldKey fieldType
 — — — — — — — — -
consumer_utilisation float
consumers integer
idle_since string
memory integer
message_bytes integer
message_bytes_persist integer
message_bytes_ram integer
message_bytes_ready integer
message_bytes_unacked integer
messages integer
messages_ack integer
messages_ack_rate float
messages_deliver integer
messages_deliver_get integer
messages_deliver_get_rate float
messages_deliver_rate float
messages_publish integer
messages_publish_rate float
messages_ready integer
messages_redeliver integer
messages_redeliver_rate float
messages_unack integer
...
##### select
> select count(usage_idle) from cpu
name: cpu
time count
 — — — — -
0 50686
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment