# Automatic Kibana index backup

**URL:** <https://discuss.elastic.co/t/automatic-kibana-index-backup/70932>\
**Category:** Kibana\
**Created:** [January 9, 2017, 10:03am UTC](https://discuss.elastic.co/t/automatic-kibana-index-backup/70932 "2017-01-09T10:03:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kay\_kay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kay_kay/32/1470_2.png) [@kay\_kay](https://discuss.elastic.co/u/kay_kay)\
**Post date:** [January 9, 2017, 10:03am UTC](https://discuss.elastic.co/t/automatic-kibana-index-backup/70932/1 "2017-01-09T10:03:09Z")

</div>

I'm trying to find the way to backup Kibana indexes in automatic manner without creating a snapshot. Is there a way to do that? Something like single command: curl [http://es:9200/.kibana/dump\_all](http://es:9200/.kibana/dump_all)?

---

<div class="post-metadata">

**Author:** ![kay\_kay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kay_kay/32/1470_2.png) [@kay\_kay](https://discuss.elastic.co/u/kay_kay)\
**Post date:** [January 9, 2017, 12:10pm UTC](https://discuss.elastic.co/t/automatic-kibana-index-backup/70932/2 "2017-01-09T12:10:49Z")

</div>

I found the way to export data:

```
curl -XPOST "http://es:9200/.kibana/_search?size=1000&pretty" -d"{"query":{"match_all":{}}}" > kibana_export.json

```

But when I try to import it, it requires type. If I specify the type, then it imports data as a subelement of the specified type:

```
cat kibana_export.json | jq -c '.[] | {"index": {"_index": ".kibana1", "_type": "dashboards"}}, .' | curl -XPOST "http://es:9200/_bulk" --data-binary @-

```

How can I just import what I have?

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [January 9, 2017, 6:55pm UTC](https://discuss.elastic.co/t/automatic-kibana-index-backup/70932/3 "2017-01-09T18:55:42Z")

</div>

You'll only want to import the source field on the second line, not all the extra metadata. The extra metadata can be used to help map the action/metadata/first line of the bulk api, specifically you'll want to pull \_index, \_type, and \_id.

Example:

```auto
{
        "_index" : ".kibana",
        "_type" : "config",
        "_id" : "5.1.2",
        "_score" : 1.0,
        "_source" : {
          "defaultIndex" : ".kibana"
        }
      }

```

becomes

```auto
{ "index": { "_index": ".kibana", "_type": "config", "_id": "5.1.2" } }
{ "defaultIndex" : ".kibana"}

```

Also before using the bulk API, you'll want to make sure you've configured mappings correctly.

---

<div class="post-metadata">

**Author:** ![kay\_kay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kay_kay/32/1470_2.png) [@kay\_kay](https://discuss.elastic.co/u/kay_kay)\
**Post date:** [January 10, 2017, 1:48pm UTC](https://discuss.elastic.co/t/automatic-kibana-index-backup/70932/4 "2017-01-10T13:48:29Z")

</div>

I understand that but I still don't know how to automate this transformation using jq.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 7, 2017, 1:48pm UTC](https://discuss.elastic.co/t/automatic-kibana-index-backup/70932/5 "2017-02-07T13:48:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
