Accessing InfluxDB Shell on InfluxDB 2.0?

Hello,

I currently have InfluxDB in this version Influx CLI 2.0.6 (git: 4db98b4c9a) build_date: 2021-04-29T16:48:12Z when I run influx version

On the other machine (quite old) I have InfluxDB Shell when I run influx -version, this is the output InfluxDB shell version: 1.5.0

I was wondering how to access InfluxDB Shell from Influx 2.0 ?, when I run influx on the machine w/ v2.0.6 it will access the Influx CLI, while on the v1.5.0 it will access InfluxDB Shell.

Help appreciated

hi, there is no shell for influx_2 [if i am not missing something]

you have few option:

#DIRECT CLI

conan@komar:~$ influx query -o foookin_paavel --skip-verify ‘from(bucket:“panaque”) |> range(start: -1h) |> filter(fn: (r) => r["_measurement"] == “humidity” and r.HumUlId == “50x29196a980” and r.HumSenKey == “16”) |> sort(columns: ["_time"], desc:true) |> limit(n:5)’ --raw
#group,false,false,true,true,false,false,true,true,true,true,true
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string
#default,_result,
,result,table,_start,_stop,_time,_value,HumSenKey,HumUlId,_field,_measurement,host
,0,2021-06-02T09:31:42.685897929Z,2021-06-02T10:31:42.685897929Z,2021-06-02T10:29:59.574Z,52,16,50x29196a980,HumDecimal,humidity,komar
,0,2021-06-02T09:31:42.685897929Z,2021-06-02T10:31:42.685897929Z,2021-06-02T10:19:13.309Z,52,16,50x29196a980,HumDecimal,humidity,komar
,0,2021-06-02T09:31:42.685897929Z,2021-06-02T10:31:42.685897929Z,2021-06-02T10:13:50.117Z,51,16,50x29196a980,HumDecimal,humidity,komar

without --raw you can have table_like output

conan@komar:~$ influx query -o foookin_paavel --skip-verify ‘from(bucket:“panaque”) |> range(start: -1h) |> filter(fn: (r) => r["_measurement"] == “humidity” and r.HumUlId == “50x29196a980” and r.HumSenKey == “16”) |> drop(columns: ["_start", “_stop”] )|> sort(columns: ["_time"], desc:true) |> limit(n:5)’
Result: _result
Table: keys: [HumSenKey, HumUlId, _field, _measurement, host]
HumSenKey:string HumUlId:string _field:string _measurement:string host:string _value:float _time:time


                16            50x29196a980              HumDecimal                humidity                   komar                            52  2021-06-02T10:29:59.574000000Z  
                16            50x29196a980              HumDecimal                humidity                   komar                            52  2021-06-02T10:19:13.309000000Z  
                16            50x29196a980              HumDecimal                humidity                   komar                            51  2021-06-02T10:13:50.117000000Z  
                16            50x29196a980              HumDecimal                humidity                   komar                            51  2021-06-02T10:08:27.098000000Z  
                16            50x29196a980              HumDecimal                humidity                   komar                            51  2021-06-02T10:03:04.282000000Z  

Table: keys: [HumSenKey, HumUlId, _field, _measurement, host]
HumSenKey:string HumUlId:string _field:string _measurement:string host:string _value:float _time:time


                16            50x29196a980                  HumKey                humidity                   komar                         23597  2021-06-02T10:29:59.574000000Z  
                16            50x29196a980                  HumKey                humidity                   komar                         23595  2021-06-02T10:19:13.309000000Z  
                16            50x29196a980                  HumKey                humidity                   komar                         23594  2021-06-02T10:13:50.117000000Z  
                16            50x29196a980                  HumKey                humidity                   komar                         23593  2021-06-02T10:08:27.098000000Z  
                16            50x29196a980                  HumKey                humidity                   komar                         23592  2021-06-02T10:03:04.282000000Z

you will need to work little bit with GROUP, JOIN, UNION if you want just one table output

#DOCKER remote access
$/usr/bin/docker container exec dck_influxdb influx query -c default --skip-verify ‘from(bucket: “aaa”) |> range(start: -1y) |> filter(fn: (r) => r["_measurement"] == “battery_adc”) |> sort(columns: ["_time"], desc:true)’ --raw

i like this influx db access as i can pipe the result to less / grep / forward or what ever

there is also some VS plug in but i am not using it
https://docs.influxdata.com/influxdb/cloud/tools/flux-vscode/

pavel

Hello,

Thanks for the answer, I think you’re correct on the part where InfluxDB v2 doesn’t have shell.