# From dev tools to Kibanna search

**URL:** <https://discuss.elastic.co/t/from-dev-tools-to-kibanna-search/199052>\
**Category:** Kibana\
**Created:** [September 11, 2019, 9:31am UTC](https://discuss.elastic.co/t/from-dev-tools-to-kibanna-search/199052 "2019-09-11T09:31:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![science162](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/science162/32/52601_2.png) [@science162](https://discuss.elastic.co/u/science162)\
**Post date:** [September 11, 2019, 9:31am UTC](https://discuss.elastic.co/t/from-dev-tools-to-kibanna-search/199052/1 "2019-09-11T09:31:53Z")

</div>

Request

```auto
GET /jmetrer_test_exec-*/_search?size=0
{
    "aggs" : {
        "sales_over_time" : {
            "date_histogram" : {
                "field" : "@timestamp",
                "format":"yyyy-MM-dd HH:mm:ss",
                "fixed_interval":"1s"
            }
        }
    }
}

```

Response

```auto
{
  "took" : 0,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 10000,
      "relation" : "gte"
    },
    "max_score" : null,
    "hits" : []
  },
  "aggregations" : {
    "sales_over_time" : {
      "buckets" : [
        {
          "key_as_string" : "2019-09-10 13:18:43",
          "key" : 1568121523000,
          "doc_count" : 1
        },
        {
          "key_as_string" : "2019-09-10 13:18:44",
          "key" : 1568121524000,
          "doc_count" : 8
        },
        {
          "key_as_string" : "2019-09-10 13:18:45",
          "key" : 1568121525000,
          "doc_count" : 21
        },
        {
          "key_as_string" : "2019-09-10 13:18:46",
          "key" : 1568121526000,
          "doc_count" : 34
        },
        {
          "key_as_string" : "2019-09-10 13:18:47",
          "key" : 1568121527000,
          "doc_count" : 57
        },
        {
          "key_as_string" : "2019-09-10 13:18:48",
          "key" : 1568121528000,
          "doc_count" : 66
        },
        {
          "key_as_string" : "2019-09-10 13:18:49",
          "key" : 1568121529000,
          "doc_count" : 75
        },
        {
          "key_as_string" : "2019-09-10 13:18:50",
          "key" : 1568121530000,
          "doc_count" : 78
        },
        {
          "key_as_string" : "2019-09-10 13:18:51",
          "key" : 1568121531000,
          "doc_count" : 96
        },
        {
          "key_as_string" : "2019-09-10 13:18:52",
          "key" : 1568121532000,
          "doc_count" : 99
        },
        {
          "key_as_string" : "2019-09-10 13:18:53",
          "key" : 1568121533000,
          "doc_count" : 112
        },
        {
          "key_as_string" : "2019-09-10 13:18:54",
          "key" : 1568121534000,
          "doc_count" : 92
        },
        {
          "key_as_string" : "2019-09-10 13:18:55",
          "key" : 1568121535000,
          "doc_count" : 97
        },
        {
          "key_as_string" : "2019-09-10 13:18:56",
          "key" : 1568121536000,
          "doc_count" : 105
        },
        {
          "key_as_string" : "2019-09-10 13:18:57",
          "key" : 1568121537000,
          "doc_count" : 105
        },
        {
          "key_as_string" : "2019-09-10 13:18:58",
          "key" : 1568121538000,
          "doc_count" : 85
        },
        {
          "key_as_string" : "2019-09-10 13:18:59",
          "key" : 1568121539000,
          "doc_count" : 52
        },
        {
          "key_as_string" : "2019-09-10 13:19:00",
          "key" : 1568121540000,
          "doc_count" : 78
        },
        {
          "key_as_string" : "2019-09-10 13:19:01",
          "key" : 1568121541000,
          "doc_count" : 49
        },
        {
          "key_as_string" : "2019-09-10 13:19:02",
          "key" : 1568121542000,
          "doc_count" : 37
        },
        {
          "key_as_string" : "2019-09-10 13:19:03",
          "key" : 1568121543000,
          "doc_count" : 55
        },
        {
          "key_as_string" : "2019-09-10 13:19:04",
          "key" : 1568121544000,
          "doc_count" : 55
        },
        {
          "key_as_string" : "2019-09-10 13:19:05",
          "key" : 1568121545000,
          "doc_count" : 57
        },
        {
          "key_as_string" : "2019-09-10 13:19:06",
          "key" : 1568121546000,
          "doc_count" : 72
        }, ...

```

Hello everybody,  
I ran this query from dev tools in Kibanna. How can I do to run it in the search part so that I could just save search and draw visualisation using Time Serie Visual builder ?

thanks in advance !!

---

<div class="post-metadata">

**Author:** ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)\
**Post date:** [September 11, 2019, 9:29pm UTC](https://discuss.elastic.co/t/from-dev-tools-to-kibanna-search/199052/2 "2019-09-11T21:29:39Z")

</div>

Hi there!

Saved searches in Kibana are used for saving filters, so that's not quite what you want here.

To build a chart with this type of aggregation, follow these steps:

- Create a new TSVB visualization
- Under Metrics \> Aggregation, choose "Count" (should be the default)
- Under Options \> Override Index Pattern, choose "Yes"
- Enter "jmetrer\_test\_exec-\*" into the "Index pattern" field
- Select "@timestamp" from the "Time Field" dropdown
- Enter "1s" into the "Interval" field

I don't believe there is a way to share this aggregation across visualizations since it's a specific query, but this should give you a graph of the same results you are retreiving in Dev Tools.

---

<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:** [October 10, 2019, 8:16am UTC](https://discuss.elastic.co/t/from-dev-tools-to-kibanna-search/199052/4 "2019-10-10T08:16:48Z")

</div>

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