通过Kibana前端查询Elasticsearch后端的CLI接口。
elasticsearch-kibana-cli的Python项目详细描述
Elasticsearch基班纳CLI
Elasticsearch Kibana CLI为 通过Kibana前端查询Elasticsearch后端,这在 无法以其他方式访问Elasticsearch后端的情况。 配置选项允许HTTP请求头重写 因此,可以在更复杂的情况下访问Kibana,这可能需要 其他身份验证,例如当Kibana在OAuth反向之后时 代理。在
项目
安装
通过PyPi
pip3 install elasticsearch-kibana-cli
通过源
^{pr2}$配置
提供的eskbcli-sample.yml
演示了可用于创建的配置选项
搜索_定义。实际上,查询字符串是使用Q
函数从
标准elasticsearch-dslPython库
有弹性。search
配置参数被加载到bool
中包装的Q
函数中
并授予must
、must_not
、should
、should_not
和{
因此,在这个例子中,Python elasticsearch dsl表达式就是这样编写的
s.query=Q('bool',must=[Q('match',title='python'),Q('match',body='best')])
因此,YML配置等价物是
search:must:match:-title:"python"-body:"best"
用户可以用一种弹性的方式来定义大多数的弹性查询。在
环境变量
标准环境变量
以下环境变量可用
- 在
{cd11>替代方法 要加载的文件。与设置
在-c
参数具有相同的效果。在 - 在
在ELASTICSEARCHKIBANACLI_LOGLEVEL
调整stderr的日志输出级别。有效设置为CRITICAL
,ERROR
,WARNING
,INFO
,DEBUG
环境变量
可以使用带有
^例如,{
header_overrides:cookie:env:GCP_IAP_COOKIE
在本例中,HTTP头覆盖配置值从GCP_IAP_COOKIE
env值加载。在
使用
usage: eskbcli [-s <search>] [-o <filename>] [-sc <split-count>]
[-hc <hit-count>] [-np] [-D] [-k <kbn_version>] [-c <filename>]
[-d]
Elasticsearch Kibana CLI v0.1.0
optional arguments:
-s <search> The search_definition name from configuration to use and
execute (hint: use -D to list).
-o <filename> Filename to write output to, by default output it written
to stdout.
-sc <split-count> Number of splits to break the search into, overrides the
config value if set (default:1).
-hc <hit-count> Search hit count limit, overrides the config value if set
min=1, max=10000 (default:10000).
-np, --noping Do not ping the Kibana endpoint before using this
connection (default: False).
-D, --defn List the configured search_definitions sections in the
config and immediately exit.
-k <kbn_version> Kibana version override, useful in some debugging
situations.
-c <filename> Override the configuration file to read, else search for
eskbcli.yml in common paths.
-d, --debug Debug level logging output (default: False).
The Elasticsearch Kibana CLI provides a configurable shell interface to
query the Elasticsearch backend via the Kibana frontend which is useful in
situations where the Elasticsearch backend is not otherwise accessible.
Configuration options are available that permit HTTP request header overrides
that hence enable access to Kibana in more complex situations that may require
additional authentication such as when Kibana is behind an OAuth reverse
proxy.
示例
$ eskbcli -d -sc 10 -s example01 -o /tmp/example01.json 20190922Z024453 - INFO - elasticsearch_kibana_cli 20190922Z024453 - INFO - version 0.1.0 20190922Z024453 - INFO - Loaded configuration filename /etc/eskbcli/eskbcli.yml 20190922Z024453 - DEBUG - Using internal_proxy to connect https://kibana.internal 20190922Z024454 - DEBUG - kbn_metadata read from cache file /tmp/elasticsearch_kibana_cli-connection-6140f131-metadata.cache 20190922Z024454 - DEBUG - Connection definition setup http://127.0.0.1:59200 20190922Z024500 - INFO - Ping okay http://127.0.0.1:59200 20190922Z024501 - INFO - Search split into 10 requests based on "range" keyword 20190922Z024502 - INFO - 2905 available-hits;2905 returned-hits;290 average-hits-per-split;10 msearch-splits
作者
许可证
有关完整许可证的详细信息,请参阅BSD-2条款。在
- 项目
标签: