Kibana - how to export search results Kibana - how to export search results elasticsearch elasticsearch

Kibana - how to export search results


This is very old post. But I think still someone searching for a good answer.

You can easily export your searches from Kibana Discover.

Click Save first, then click Share

Click **Save** first, then click **Share**

Click CSV Reports

Click CSV Reports

Then click Generate CSV

Then click **Generate CSV**

After a few moments, you'll get download option bottom right side.


If you want to export the logs (not just the timestamp and counts), you have a couple of options (tylerjl answered this question very well on the Kibana forums):

If you're looking to actually export logs from Elasticsearch, you probably want to save them somewhere, so viewing them in the browser probably isn't the best way to view hundreds or thousands of logs. There are a couple of options here:

  • In the "Discover" tab, you can click on the arrow tab near the bottom to see the raw request and response. You could click "Request" and use that as a query to ES with curl (or something similar) to query ES for the logs you want.

  • You could use logstash or stream2es206 to dump out the contents of a index (with possible query parameters to get the specific documents you want.)


This works with Kibana v 7.2.0 - export query results into a local JSON file. Here I assume that you have Chrome, similar approach may work with Firefox.

  1. Chrome - open Developer Tools / Network
  2. Kibana - execute your query
  3. Chrome - right click on the network call and choose Copy / Copy as cURL
  4. command line - execute [cURL from step 3] > query_result.json . The query response data is now stored in query_result.json

Edit: To drill down into the source nodes in the resulting JSON file using jq:

jq '.responses | .[]  | .hits  | .hits | .[]._source ' query_result.json