Using the Kibana Console UI

Before we start writing our first queries to interact with Elasticsearch, we should familiarize ourselves with a very important tool: Kibana Console. This is important because Elasticsearch has a very rich REST API, allowing you to do all sorts of operations with Elasticsearch. Kibana Console has an editor that is very capable and aware of the REST API. It allows for auto completion, and for the formatting of queries as you write them.

What is a REST API? REST stands for Representational State Transfer. It is an architectural style that's used to make systems inter operate and interact with each other. REST has evolved along with the HTTP protocol, and almost all REST-based systems use HTTP as their protocol. HTTP supports different methods, including GET, POST, PUT, DELETE, HEAD, and more, which are used for different semantics. For example, GET is used for getting or searching for something, POST is used for creating a new resource, PUT may be used for creating or updating an existing resource, and DELETE may be used for deleting a resource permanently.

In Chapter 1, Introducing the Elastic Stack, we successfully installed Kibana and launched the UI at http://localhost:5601. As we mentioned previously, Kibana is the window into the Elastic Stack. It not only provides insight into the data through visualizations, but it also has developer tools such as the Console. The following diagram shows the Console UI:

Figure 2.1: Kibana Console

In Kibana 7.0, you can navigate to the Console by first clicking on Console under Manage and Administer the Elastic Stack. The Console is divided into two parts: the editor pane and the results pane. You can type the REST API command and press the green triangle-like icon, which sends the query to the Elasticsearch instance (or cluster).

Here, we have simply sent the GET / query. This is equivalent to the curl command that we sent to Elasticsearch for testing the setup, that is, curl http://localhost:9200. As you can see, the length of the command that's sent via the Console is already more concise than the curl command. You don't need to type http followed by the host and port of the Elasticsearch node, that is, http://localhost:9200. However, as we mentioned earlier, there is much more to it than just skipping the host and port with every request. As you start typing in the Console editor, you will get an autosuggestion dropdown, as displayed in the following screenshot:

Figure 2.2: Kibana Dev Tools Console autosuggestions

Now that we have the right tool to generate and send queries to Elasticsearch, let's continue learning about the core concepts.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.197.143