How do I use Elasticsearch in Kibana

  • Configure security in Elasticsearch.
  • Configure Kibana to use the appropriate built-in user.

    Update the following settings in the configuration file:

    elasticsearch.username: "kibana" elasticsearch.password: "kibanapassword"

    The Kibana server submits requests as this user to access the cluster monitoring APIs and the index. The server does not need access to user indices.

    The password for the built-in user is typically set as part of the X-Pack security configuration process on Elasticsearch. For more information, see Built-in users.

  • Set the property in the configuration file. You can use any text string that is 32 characters or longer as the encryption key. "something_at_least_32_characters"

    For more information, see Security Settings in Kibana.

  • Optional: Change the default session duration. By default, sessions stay active until the browser is closed. To change the duration, set the property in the configuration file. The timeout is specified in milliseconds. For example, set the timeout to 600000 to expire sessions after 10 minutes: 600000
  • Optional: Configure Kibana to encrypt communications.
  • Restart Kibana.
  • Choose an authentication mechanism and grant users the privileges they need to use Kibana.

    For more information on Basic Authentication and additional methods of authenticating Kibana users, see Authentication.

    You can manage privileges on the Management / Security / Roles page in Kibana.

    If you’re using the native realm with Basic Authentication, you can assign roles using the Management / Security / Users page in Kibana or the user management APIs. For example, the following creates a user named and assigns it the role:

    POST /_security/user/jacknich { "password" : "t0pS3cr3t", "roles" : [ "kibana_user" ] }
  • Grant users access to the indices that they will be working with in Kibana.

    For example, create roles that have and privileges on specific index patterns. For more information, see User authorization.

    You can define as many different roles for your Kibana users as you need.

  • Verify that you can log in as a user. If you are running Kibana locally, go to and enter the credentials for a user you’ve assigned a Kibana user role. For example, you could log in as the user created above.

    This must be a user who has been assigned Kibana privileges. Kibana server credentials should only be used internally by the Kibana server.