//////////////////////////////////////////////////////////////////////////
//// This content is shared by all Elastic Beats. Make sure you keep the
//// descriptions here generic enough to work for all Beats that include
//// this file. When using cross references, make sure that the cross
//// references resolve correctly for any files that include this one.
//// Use the appropriate variables defined in the index.asciidoc file to
//// resolve Beat names: beatname_uc and beatname_lc.
//// Use the following include to pull this content into a doc file:
//// include::../../libbeat/docs/shared-kibana-config.asciidoc[]
//////////////////////////////////////////////////////////////////////////

[[setup-kibana-endpoint]]
== Configure the {kib} endpoint

++++
<titleabbrev>{kib} endpoint</titleabbrev>
++++

{kib} dashboards are loaded into {kib}
via the {kib} API. This requires a {kib} endpoint configuration. For details on
authenticating to the {kib} API, see {kibana-ref}/api.html#api-authentication[Authentication].

You configure the endpoint in the `setup.kibana` section of the
+{beatname_lc}.yml+ config file.

Here is an example configuration:

[source,yaml]
----
setup.kibana.host: "http://localhost:5601"
----

[float]
=== Configuration options

You can specify the following options in the `setup.kibana` section of the
+{beatname_lc}.yml+ config file:

[float]
==== `setup.kibana.host`

The {kib} host where the dashboards will be loaded. The default is
`127.0.0.1:5601`. The value of `host` can be a `URL` or `IP:PORT`. For example: `http://192.15.3.2`, `192:15.3.2:5601` or `http://192.15.3.2:6701/path`. If no
port is specified, `5601` is used.

NOTE: When a node is defined as an `IP:PORT`, the _scheme_ and _path_ are taken
from the <<kibana-protocol-option,setup.kibana.protocol>> and
<<kibana-path-option,setup.kibana.path>> config options.

IPv6 addresses must be defined using the following format:
`https://[2001:db8::1]:5601`.

[float]
[[kibana-protocol-option]]
==== `setup.kibana.protocol`

The name of the protocol {kib} is reachable on. The options are: `http` or
`https`. The default is `http`. However, if you specify a URL for host, the
value of `protocol` is overridden by whatever scheme you specify in the URL.

Example config:

[source,yaml]
----
setup.kibana.host: "192.0.2.255:5601"
setup.kibana.protocol: "http"
setup.kibana.path: /kibana
----


[float]
==== `setup.kibana.username`

The basic authentication username for connecting to {kib}. If you don't
specify a value for this setting, {beatname_uc} uses the `username` specified
for the {es} output.

[float]
==== `setup.kibana.password`

The basic authentication password for connecting to {kib}. If you don't
specify a value for this setting, {beatname_uc} uses the `password` specified
for the {es} output.

[float]
[[kibana-path-option]]
==== `setup.kibana.path`

An HTTP path prefix that is prepended to the HTTP API calls. This is useful for
the cases where {kib} listens behind an HTTP reverse proxy that exports the API
under a custom prefix.

[float]
[[kibana-space-id-option]]
==== `setup.kibana.space.id`

The {kibana-ref}/xpack-spaces.html[Kibana space] ID to use. If specified,
{beatname_uc} loads {kib} assets into this {kib} space. Omit this option to
use the default space.

[float]
===== `setup.kibana.headers`

Custom HTTP headers to add to each request sent to {kib}.
Example:

[source,yaml]
------------------------------------------------------------------------------
setup.kibana.headers:
  X-My-Header: Header contents
------------------------------------------------------------------------------

[float]
==== `setup.kibana.ssl.enabled`

Enables {beatname_uc} to use SSL settings when connecting to {kib} via HTTPS.
If you configure {beatname_uc} to connect over HTTPS, this setting defaults to
`true` and {beatname_uc} uses the default SSL settings.

Example configuration:

[source,yaml]
----
setup.kibana.host: "https://192.0.2.255:5601"
setup.kibana.ssl.enabled: true
setup.kibana.ssl.certificate_authorities: ["/etc/client/ca.pem"]
setup.kibana.ssl.certificate: "/etc/client/cert.pem"
setup.kibana.ssl.key: "/etc/client/cert.key
----

See <<configuration-ssl>> for more information.
