Connect data and tools to your Elastic nightshift investigations
An investigation can only test what it can reach. Connect the telemetry, code, configuration, and runbooks that your team uses during an incident, and investigations can check them too. Setting up for the first time? Start with Get started.
Investigations can use the following connections:
- Local Elasticsearch: Logs, metrics, and traces in your Elastic nightshift project, created when Elastic nightshift is enabled.
- External Elasticsearch: Data in another cluster or project, or in projects linked through cross-project search.
- GitHub: Code, configuration, runbooks, and recent commits, pull requests, and issues. Connecting gives more information on why something broke.
- HTTP: Data from any other API, such as a runbook service or deploy history. Optional.
- Slack: A place to ask for help and to post results. Optional, but required to post automation results to a channel.
To reach any other tool, use an HTTP connector. Refer to Extend investigations.
- An admin has enabled Elastic nightshift.
- You have the privileges to open the Settings page. Refer to Grant access.
You manage connections on the General tab of the Settings page. On the Elastic nightshift home page, open the menu and select Settings.
To add a connector, select Add connector. The flyout lists the connector types that investigations can use, with how many you have of each. Select Create connector next to a type. Investigations can use only connectors that you add from this flyout. A connector that you create in Stack Management isn't assigned to investigations. To manage connectors in the rest of Kibana, select Open in Stack Management. Refer to Connectors.
Investigations reach your systems through connectors, from a temporary sandbox.
- Each investigation gets its own sandbox: which is discarded when the investigation ends.
- Connectors hold shared credentials: A connector uses one set of credentials for every investigation, from whoever started it.
- Access is as read-only as your credentials: Give every connector, HTTP included, credentials that can only read, such as a read-only Elasticsearch API key and GitHub token. A connector with write access lets investigations write too. The exception is a connector for remediation workflows. Refer to Remediate with workflows.
- The sandbox can reach only known hosts: A command that uses a connector can reach that connector's host. To allow other hosts, refer to Sandbox egress allowlist.
When Elastic nightshift is enabled, it creates a Local Elasticsearch connector, type .elasticsearch, that investigations use to query the logs, metrics, and traces in this project. You don't need to set anything up. Don't delete it.
The Local Elasticsearch connector searches only this project. To search projects linked through cross-project search, add an External Elasticsearch connector with an API key that has connected cluster access. Refer to Search projects linked through cross-project search.
Add an External Elasticsearch connector when your data is in another cluster or project, for example a separate production deployment, or in projects linked through cross-project search. For what works with each deployment type, refer to Reference architecture.
For the steps, including the API key request, refer to Add data. After setup, start from Add connector on the General tab, then select Create connector next to External Elasticsearch.
Authentication
API key format. Paste the encoded value as it is. You don't need to add the ApiKey prefix: Kibana adds it when it's missing. If you already added it, that works too.
Username and password. You can also authenticate with a Username and password. The user needs at least the read privilege on the indices that investigations search. An API key is easier to limit and to revoke.
For all connector settings, refer to External Elasticsearch connector.
To let investigations search the projects linked to your Elastic nightshift project, create an External Elasticsearch connector that points to the Elastic nightshift project, with an API key that you create in the Elastic Cloud console. An API key that you create in Kibana can't search linked projects.
- In the Elastic Cloud console, open your Elastic nightshift project and select Manage project.
- Select Actions at the top right, then Create API key.
- Turn on Cloud resource access, and grant at least the Viewer role on the project.
- Turn on Connected cluster access.
- Create the key, and copy its
encodedvalue. - Copy the Elasticsearch endpoint of the Elastic nightshift project.
- Create an External Elasticsearch connector with this endpoint and API key. Follow the steps in Add data, and skip the API key request.
Connect GitHub so investigations can read the code, configuration, Helm charts, and runbooks behind your services, and check what changed recently. For example, an investigation into database lock timeouts can find the commit that changed the query.
Elastic nightshift doesn't copy, sync, or index your repositories. Refer to Your code.
For the steps to create a fine-grained personal access token and connect it, refer to Connect GitHub. After setup, start from Add connector on the General tab, then select Create connector next to GitHub. Leave Receive events turned off: investigations don't need it.
To point investigations at the right repositories, name them in the instructions of an automation, or in custom context. For example, "The source for the checkout services is in acme/checkout." Refer to Automation instructions and Custom context.
For all GitHub connector settings, refer to GitHub connector.
Add an HTTP connector to reach any other system with an HTTP API, for example a runbook service, your CI system, or a deploy log: on the General tab, select Add connector, then HTTP. Describe the API in custom context. Refer to Connect any system with an HTTP API.
Connect Slack so your team can ask Elastic nightshift for help in a channel, and automations can post results there. An admin connects the workspace once, then each channel. Private channels need extra access and work only with mentions. Refer to Private channels.
On the Elastic nightshift Settings page, on the General tab, in the Slack section, select Connect Slack.
Authorize the
@ElasticSlack app in Slack. When Kibana asks Is this the right workspace?, select Yes.The authorization applies to the whole Slack workspace, including every Elastic deployment that's connected to it.
In Slack, invite
@Elasticto each channel that you want to use, for example with/invite @Elastic.Back in Slack channels, select Connect channels.
In Connect a channel, select the channel from the Channel list, then select Connect. The list shows only public channels, so for a private channel, or any channel that isn't listed, enter its channel ID or a link copied from Slack.
The channel appears in the Channels table with its name and ID. A private channel shows only its ID. @Elastic answers only in connected channels.
To stop @Elastic from answering in a channel, select Disconnect channel next to it. The bot stays in the channel until someone removes it in Slack, and replies that the channel isn't connected when someone mentions it. To remove the whole workspace, open the workspace's actions menu and select Disconnect workspace.
A mention of @Elastic that opens a new conversation in a connected channel gets an answer, not an investigation. It still counts toward the Manual investigations daily limit. For what your team can do in Slack, refer to Investigate in Slack. For the Slack permissions that the app requests, how it behaves in channels, and what Slack data Elastic stores, refer to Elastic app for Slack.
The investigation sandbox can reach only your connectors' hosts and the hosts you allow. To allow others, such as a package index to install a tool, use the allowlist on the Investigations tab of the Settings page. For the rule syntax, refer to Sandbox egress allowlist.
- How investigations work: Learn how investigations use your data and code.
- Automations: Start investigations for you, and post the results to Slack.
- Investigate in Slack: Ask Elastic nightshift for help from a connected channel.
- Extend investigations: Add custom context, connect other APIs, and let investigations run your workflows.