Kibana 插件 [4.2版本的新特性]

Kibana 支持通过安装插件的形式来为它增添新的功能。你可以使用 bin/kibana plugin 命令来管理插件。你也可以把一个插件手动安装插件,具体做法是将插件压缩包移动到 installedPlugins 目录下,并解压成一个新的文件夹。

Github 上有个插件列表,列举了部分 Kibana 的可用的插件:https://github.com/elastic/kibana/wiki/Known-Plugins

安装插件

安装插件的命令格式如下:

bin/kibana plugin --install <org>/<package>/<version>

--install 也可以简写成 -i:

bin/kibana plugin -i elasticsearch/marvel/latest

应该 marvel 插件是 elasticsearch 提供的,所以插件管理工具会自动去 download.elastic.co 上下载这个插件。

通过 URL 来安装插件

你可以使用 -u 或者 --url 参数然后紧跟一个 URL 地址这样的格式来安装插件:

bin/kibana plugin -i sample-plugin -u https://some.sample.url/directory
Installing sample-plugin
Attempting to extract from https://some.sample.url/directory
Downloading <some number> bytes....................
Extraction complete
Optimizing and caching browser bundles...
Plugin installation complete

这种方式支持 HTTP,HTTPS 或者 FILE 协议。

把插件安装到任意目录

你可以使用 --plugin-dir 或者它的简写形式 -d 来为插件指定一个安装路径:

bin/kibana plugin -i elasticsearch/sample-plugin/latest -d <path/to/directory>
Installing sample-plugin
Attempting to extract from https://download.elastic.co/elasticsearch/sample-plugin/sample-plugin-latest.tar.gz
Downloading <some number> bytes....................
Extraction complete
Optimizing and caching browser bundles...
Plugin installation complete

> **注意**
> 
> 如果指定的目录不存在的话,该命令会尝试去创建这个目录

### 卸载插件

使用 --remove 或者它的简写形式 -r 来卸载插件,这也将抹除该插件的所有配置信息:

```bash
bin/kibana plugin --remove marvel

你也可以通过手动删除 installedPlugins 文件夹下该插件对应的子文件夹,来卸载这个插件。

查看已安装的插件

使用 --list 或者它的简写形式 -i 来查看所有已安装的插件

更新插件

要更新一个插件,目前的做法只能是删掉重装 真辣鸡

配置插件管理器

默认情况下,插件管理器会反馈给你命令的执行状况信息。你可以调整反馈信息的重要级别,可选项有 --quiet 和 --silent。--quiet 选项可以屏蔽掉所有的非 error 输出信息。而 --silent 选项则会屏蔽掉所有的信息。

默认情况下,插件管理器不会判断是否超时,你可以使用 --timeout 后跟一个时间来设置超时时间:

设置超时时间为 30 秒(30 seconds)

bin/kibana plugin --install username/sample-plugin --timeout 30s

设置超时时间为 1 分钟(1 minute)

bin/kibana plugin --install username/sample-plugin --timeout 1m

当你在使用非默认路径的配置文件时

使用 --config 或者 -c 可以指定用于启动 Kibana 的配置文件的路径。默认路径是 config/kibana.yml。当你改变你的插件时,bin/kibana plugin 命令也会重启你的 Kibana 服务。如果你在使用一个非默认路径下的配置文件,那你在每次使用 bin/kibana plugin 命令的时候都得手动地指明配置文件的路径。

插件管理器的退出码

退出码 含义
0 成功
64 未知的命令或不正确的 option 参数
74 I/O 错误
70 其他类型的错误

切换插件

Kibana UI 提供了切换插件的功能。你可以点击 Plugin Chooser 按钮来显示已安装的插件的按钮,点击按钮即可切换使用该插件。

gras


Kibana Plugins [since v4.2]

Add-on functionality for Kibana is implemented with plug-in modules. You can use the bin/kibana plugin command to manage these modules. You can also install a plugin manually by moving the plugin file to the installedPlugins directory and unpacking the plugin files into a new directory.

A list of existing Kibana plugins is available on GitHub.

Installing Plugins

Use the following command to install a plugin:

bin/kibana plugin --install <org>/<package>/<version>

You can also use -i instead of --install, as in the following example:

bin/kibana plugin -i elasticsearch/marvel/latest

Because the organization given is elasticsearch, the plugin management tool automatically downloads the plugin from download.elastic.co.

Installing Plugins from an Arbitrary URL

You can specify a URL to a plugin with the -u or --url options after the -i or --install option, as in the following example:

bin/kibana plugin -i sample-plugin -u https://some.sample.url/directory
Installing sample-plugin
Attempting to extract from https://some.sample.url/directory
Downloading <some number> bytes....................
Extraction complete
Optimizing and caching browser bundles...
Plugin installation complete

You can specify URLs that use the HTTP, HTTPS, or file protocols.

Installing Plugins to an Arbitrary Directory

Use the -d or --plugin-dir option to specify a directory for plugins, as in the following example:

bin/kibana plugin -i elasticsearch/sample-plugin/latest -d <path/to/directory>
Installing sample-plugin
Attempting to extract from https://download.elastic.co/elasticsearch/sample-plugin/sample-plugin-latest.tar.gz
Downloading <some number> bytes....................
Extraction complete
Optimizing and caching browser bundles...
Plugin installation complete

> **Note**
> 
> This command creates the specified directory if it does not already exist.

### Removing Plugins

Use the --remove or -r option to remove a plugin, including any configuration information, as in the following example:

```bash
bin/kibana plugin --remove marvel

You can also remove a plugin manually by deleting the plugin’s subdirectory under the installedPlugins directory.

Listing Installed Plugins

Use --list or -l option to list the currently installed plugins.

Updating Plugins

To update a plugin, remove the current version and reinstall the plugin.

Configuring the Plugin Manager

By default, the plugin manager provides you with feedback on the status of the activity you’ve asked the plugin manager to perform. You can control the level of feedback with the --quiet and --silent options. Use the --quiet option to suppress all non-error output. Use the --silent option to suppress all output.

By default, plugin manager requests do not time out. Use the --timeout option, followed by a time, to change this behavior, as in the following examples:

Waits for 30 seconds before failing.

bin/kibana plugin --install username/sample-plugin --timeout 30s

Waits for 1 minute before failing.

bin/kibana plugin --install username/sample-plugin --timeout 1m

Plugins and Custom Kibana Configurations

Use the -c or --config options to specify the path to the configuration file used to start Kibana. By default, Kibana uses the configuration file config/kibana.yml. When you change your installed plugins, the bin/kibana plugin command restarts the Kibana server. When you are using a customized configuration file, you must specify the path to that configuration file each time you use the bin/kibana plugin command.

Plugin Manager Exit Codes

exit code description
0 Success
64 Unknown command or incorrect option parameter
74 I/O error
70 Other error

Switching Plugin Functionality

The Kibana UI serves as a framework that can contain several different plugins. You can switch between these plugins by clicking the Plugin Chooser Plugin chooser button to display icons for the installed plugins:

gras

Click a plugin’s icon to switch to that plugin’s functionality.

results matching ""

    No results matching ""