# Import new search to kibana via command line

**URL:** <https://discuss.elastic.co/t/import-new-search-to-kibana-via-command-line/82028>\
**Category:** Elasticsearch\
**Created:** [April 11, 2017, 5:40pm UTC](https://discuss.elastic.co/t/import-new-search-to-kibana-via-command-line/82028 "2017-04-11T17:40:25Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [April 11, 2017, 5:40pm UTC](https://discuss.elastic.co/t/import-new-search-to-kibana-via-command-line/82028/1 "2017-04-11T17:40:25Z")

</div>

Hello,

I am trying to import new search to elasticsearch .kibana index. Any idea how can I achieve that?

Regards,  
Peter

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [April 11, 2017, 6:17pm UTC](https://discuss.elastic.co/t/import-new-search-to-kibana-via-command-line/82028/2 "2017-04-11T18:17:26Z")

</div>

I'm not sure what you mean by import new search. So you wrote a query that you want to import into Kibana? Please elaborate.

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [April 11, 2017, 6:20pm UTC](https://discuss.elastic.co/t/import-new-search-to-kibana-via-command-line/82028/3 "2017-04-11T18:20:02Z")

</div>

In kibana you have multiple searches. I want to create new search for every newly added customer so that I can create a separate visualizations/dashboard for each of them. However I would like to script that process and do it via command line. Is there any ways to do that?

Regards,  
Peter

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [April 11, 2017, 7:25pm UTC](https://discuss.elastic.co/t/import-new-search-to-kibana-via-command-line/82028/4 "2017-04-11T19:25:21Z")

</div>

Or better is there a way to setup new searches/visualizations/dashboards via command line for kibana?

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [April 11, 2017, 7:46pm UTC](https://discuss.elastic.co/t/import-new-search-to-kibana-via-command-line/82028/5 "2017-04-11T19:46:56Z")

</div>

There is a similar discussion. Take a look at the link below:

> [@How to create visualization on the fly using a script](https://discuss.elastic.co/t/how-to-create-visualization-on-the-fly-using-a-script/31255/10):
>
> when will the 5.0 be released？ thxs!

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [April 11, 2017, 11:21pm UTC](https://discuss.elastic.co/t/import-new-search-to-kibana-via-command-line/82028/6 "2017-04-11T23:21:34Z")

</div>

This does not cover how to create kibana searches via scripts

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [April 12, 2017, 12:18am UTC](https://discuss.elastic.co/t/import-new-search-to-kibana-via-command-line/82028/7 "2017-04-12T00:18:49Z")

</div>

I'm still a bit confused on what you mean by Kibana searches. Like using the Dev Tool to run queries or the Kibana visualization.

If it's the Kibana visualization , according to the discussion link :

> [@How to create visualization on the fly using a script](https://discuss.elastic.co/t/how-to-create-visualization-on-the-fly-using-a-script/31255/2):
>
> Most of the parameters you need to create visualizations and dashboards are stored in the URL state in Kibana 4. After creating a sample vis or dashboard, you should be able to examine the URL and decide what to parameterize.

Yes, you have to test it yourself to figure the params. It does not cover how.

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [April 12, 2017, 8:02am UTC](https://discuss.elastic.co/t/import-new-search-to-kibana-via-command-line/82028/8 "2017-04-12T08:02:39Z")

</div>

In order to create visualizations you either need to create a new search for each visualization or use saved searches. Those saved searches are the purpose of this thread, But not able to figure out how to add them to the .kibana index.

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [April 12, 2017, 5:07pm UTC](https://discuss.elastic.co/t/import-new-search-to-kibana-via-command-line/82028/9 "2017-04-12T17:07:24Z")

</div>

There is no good way to do this as there is no Kibana API. In order to put the save searches into the .kibana index you will need to know all, if not most of the values that goes with it's mapping. Unfortunately, you will have to do test and error. You will have to generate some visuals in Kibana to see the params and values it generates and see if you can locate some common pattern to script this.

> <https://github.com/elastic/kibana/issues/3580>

---

<div class="post-metadata">

**Author:** ![zozo6015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zozo6015/32/12117_2.png) [@zozo6015](https://discuss.elastic.co/u/zozo6015)\
**Post date:** [April 12, 2017, 6:09pm UTC](https://discuss.elastic.co/t/import-new-search-to-kibana-via-command-line/82028/10 "2017-04-12T18:09:02Z")

</div>

OK, it seam this way it not doable. However kibana have a manage page where I can import previously exported/edited searches as a new search. Is there a way to import that from curl request or should I ask the question in kibana section?

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [April 12, 2017, 6:23pm UTC](https://discuss.elastic.co/t/import-new-search-to-kibana-via-command-line/82028/11 "2017-04-12T18:23:09Z")

</div>

Yes, please ask in the Kibana section.

---

<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:** [May 10, 2017, 6:23pm UTC](https://discuss.elastic.co/t/import-new-search-to-kibana-via-command-line/82028/12 "2017-05-10T18:23:26Z")

</div>

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