通过Kibana前端查询Elasticsearch后端的CLI接口。

elasticsearch-kibana-cli的Python项目详细描述


Elasticsearch基班纳CLI

PyPiBuild Status

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函数中 并授予mustmust_notshouldshould_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的日志输出级别。有效设置为 CRITICALERRORWARNINGINFODEBUG

环境变量

可以使用带有 ^例如,{}前缀

header_overrides:cookie:env:GCP_IAP_COOKIE

在本例中,HTTP头覆盖配置值从GCP_IAP_COOKIEenv值加载。在

使用

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

作者

Nicholas de Jong

许可证

有关完整许可证的详细信息,请参阅BSD-2条款。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Java+Brave+Zipkin:问题是,跟踪总是一样的   swing能否取消Java中的特定TimerTask?   java以编程方式重新运行失败的TestNG测试   java DefaultMessageListenerContainer未从IBM MQ读取消息   使循环结果显示在一个数组到一个数组中。Java中的toString   tomcat java。lang.NoClassDefFoundError在对GlassFish/Payara部署战争时出错   Java中的增量算法   Java中lambda类的类名是什么意思?   java图像url无法加载安卓 Imageview实际图像为“PNG”格式   java如何使用JPA使库对象数据库持久化?   java如何让onClickListener从另一个活动接收意图信息   运行时如何使Java程序反复启动   java如何在Spring上的ApacheCamel中一开始就并行运行两条路由?   java如何使用SeleniumWebDriver从以下div获取文本   将Google电子表格API与JAVA一起使用时,引用中的excel公式单元格值未更新   fileinputstream如何在Java中读/写HashMap对象到文件?   使用java调用Postgresql的过程   仅在集合中使用java方法