TomonoriSoejima / Tejun

notes related to working cases
5 stars 3 forks source link

How to get search profile.md #7

Open TomonoriSoejima opened 4 years ago

TomonoriSoejima commented 4 years ago

1. Run the request from Kibana with the profile parameter. Example

GET /twitter/_search
{
  "profile": true,
  "query" : {
    "match" : { "message" : "some number" }
  }
}

Details : https://www.elastic.co/guide/en/elasticsearch/reference/current/search-profile.html#search-profile-api-example

2. capture the response

3. Copy the response into the left pane of Search Profiler in Kibana UI

Details: https://www.elastic.co/guide/en/kibana/current/xpack-profiler.html

In the right pane, you will get a summary of the analysis.

If you run into any errors, you may want to sanitize it first with tools like kibana2json.

Special handling for msearch response

Note that response from msearch can not be inserted straight into the pane as the UI currently is limited to parsing a response from a single request.

Thus you will need to break the response into an individual response.

Let's say you saved the response in raw.response.json You can extract the first response like this.

kibana2json < raw.response.json | jq -r .responses[0]