# How i put a response into a kibana URL

**URL:** <https://discuss.elastic.co/t/how-i-put-a-response-into-a-kibana-url/350410>\
**Category:** Elasticsearch\
**Created:** [January 4, 2024, 8:18pm UTC](https://discuss.elastic.co/t/how-i-put-a-response-into-a-kibana-url/350410 "2024-01-04T20:18:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Natanael\_Rodrigues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/natanael_rodrigues/32/130543_2.png) [@Natanael\_Rodrigues](https://discuss.elastic.co/u/Natanael_Rodrigues)\
**Post date:** [January 4, 2024, 8:18pm UTC](https://discuss.elastic.co/t/how-i-put-a-response-into-a-kibana-url/350410/1 "2024-01-04T20:18:37Z")

</div>

Hello all,

I have a script that will execute at a Unix serve

```auto
curl -X POST "htt..xxxxx/xxxxx*/_search?pretty=" -H 'authorization: Basic xxxxxxxx' -H 'content-type: application/json' -d '{
  "aggs": {
    "2": {
      "terms": {
        "field": "app.name.keyword",
        "order": {
          "_count": "desc"
        },
        "size": 10000
      },
      "aggs": {
        "3": {
          "terms": {
            "field": "apiproxy.name.keyword",
            "order": {
              "_count": "desc"
            },
            "size": 10000
          },
          "aggs": {
            "4": {
              "filters": {
                "filters": {
                  "message.status.code >299 and message.status.code <499 and NOT message.status.code =429": {
                    "bool": {
                      "must": [],
                      "filter": [
                        {
                          "bool": {
                            "filter": [
                              {
                                "bool": {
                                  "should": [
                                    {
                                      "range": {
                                        "message.status.code": {
                                          "gt": 299
                                        }
                                      }
                                    }
                                  ],
                                  "minimum_should_match": 1
                                }
                              },
                              {
                                "bool": {
                                  "filter": [
                                    {
                                      "bool": {
                                        "should": [
                                          {
                                            "range": {
                                              "message.status.code": {
                                                "lt": 499
                                              }
                                            }
                                          }
                                        ],
                                        "minimum_should_match": 1
                                      }
                                    },
                                    {
                                      "bool": {
                                        "must_not": {
                                          "multi_match": {
                                            "type": "best_fields",
                                            "query": "message.status.code =429",
                                            "lenient": true
                                          }
                                        }
                                      }
                                    }
                                  ]
                                }
                              }
                            ]
                          }
                        }
                      ],
                      "should": [],
                      "must_not": []
                    }
                  },
                  "message.status.code <299": {
                    "bool": {
                      "must": [],
                      "filter": [
                        {
                          "bool": {
                            "should": [
                              {
                                "range": {
                                  "message.status.code": {
                                    "lt": 299
                                  }
                                }
                              }
                            ],
                            "minimum_should_match": 1
                          }
                        }
                      ],
                      "should": [],
                      "must_not": []
                    }
                  },
                  "message.status.code >499": {
                    "bool": {
                      "must": [],
                      "filter": [
                        {
                          "bool": {
                            "should": [
                              {
                                "range": {
                                  "message.status.code": {
                                    "gt": 499
                                  }
                                }
                              }
                            ],
                            "minimum_should_match": 1
                          }
                        }
                      ],
                      "should": [],
                      "must_not": []
                    }
                  },
                  "message.status.code = 429": {
                    "bool": {
                      "must": [],
                      "filter": [
                        {
                          "multi_match": {
                            "type": "best_fields",
                            "query": "message.status.code = 429",
                            "lenient": true
                          }
                        }
                      ],
                      "should": [],
                      "must_not": []
                    }
                  }
                }
              },
              "aggs": {
                "5": {
                  "filters": {
                    "filters": {
                      "totalLatency > 3000": {
                        "bool": {
                          "must": [],
                          "filter": [
                            {
                              "bool": {
                                "should": [
                                  {
                                    "range": {
                                      "totalLatency": {
                                        "gt": 3000
                                      }
                                    }
                                  }
                                ],
                                "minimum_should_match": 1
                              }
                            }
                          ],
                          "should": [],
                          "must_not": []
                        }
                      },
                      "totalLatency < 3000": {
                        "bool": {
                          "must": [],
                          "filter": [
                            {
                              "bool": {
                                "should": [
                                  {
                                    "range": {
                                      "totalLatency": {
                                        "lt": 3000
                                      }
                                    }
                                  }
                                ],
                                "minimum_should_match": 1
                              }
                            }
                          ],
                          "should": [],
                          "must_not": []
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "size": 0,
  "_source": {
    "excludes": []
  },
  "stored_fields": [
    "*"
  ],
  "script_fields": {},
  "docvalue_fields": [
    {
      "field": "client.received.start.datetime",
      "format": "date_time"
    },
    {
      "field": "received.datetime",
      "format": "date_time"
    }
  ],
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "match_all": {}
        },
        {
          "match_all": {}
        },
        {
          "range": {
            "client.received.start.datetime": {
              "format": "strict_date_optional_time",
              "gte": "2024-01-03T12:17:55.095Z",
              "lte": "2024-01-03T12:32:55.095Z"
            }
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  }
}'

```

but the curl ht…://xxxx/onlineapigeecampinasprod\*/\_search?pretty= they send me to a page with a kibana response how i change this?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/c/0c015cd61cf50b84df7fa78f916fd324bd6e5946.jpeg)

by the end i want to extract kibana logs

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [January 4, 2024, 10:01pm UTC](https://discuss.elastic.co/t/how-i-put-a-response-into-a-kibana-url/350410/2 "2024-01-04T22:01:55Z")

</div>

Hi @Natanael_Rodrigues Welcome to the community.

What version are you running?

It is not clear what your issue is... or what you installation you used.

> [@Natanael\_Rodrigues](#):
>
> by the end i want to extract kibana logs

Do you want to view your logs in Kibana? (I see kibana Tabs... old Kibana)

Have you installed Kibana?

Is there a proxy?

> [@Natanael\_Rodrigues](#):
>
> but the curl ht…://xxxx/onlineapigeecampinasprod\*/\_search?pretty= they send me to a page with a kibana response how i change this?

I am not clear what you mean ... generally `curl` responds on the command line I am not sure why it is opening a browser.

Apologies... It is not clear what you are trying to accomplish.

---

<div class="post-metadata">

**Author:** ![Natanael\_Rodrigues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/natanael_rodrigues/32/130543_2.png) [@Natanael\_Rodrigues](https://discuss.elastic.co/u/Natanael_Rodrigues)\
**Post date:** [January 5, 2024, 2:10pm UTC](https://discuss.elastic.co/t/how-i-put-a-response-into-a-kibana-url/350410/3 "2024-01-05T14:10:53Z")

</div>

Hi Stephen, thanks u  
I think I didn't explain it correctly, I have a Unix server and I need to create a script so that it extracts data from a visualization that I have ready in Kibana (I don't have full access to Elasticsearch, just Kibana) and I already have a script ready and running, however it has another IP and on that IP link when I click it opens a page with the kibana request a \*/\_search?pretty=" I wanted to know if I can make an API like this just with KIBANA

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [January 5, 2024, 3:25pm UTC](https://discuss.elastic.co/t/how-i-put-a-response-into-a-kibana-url/350410/4 "2024-01-05T15:25:06Z")

</div>

Hi @Natanael_Rodrigues

I am so sorry I am still not quite clear.. we do have other members that most likely speak your native language... you could try that. Your english is great! it is probably just me ☹

> [@Natanael\_Rodrigues](#):
>
> however it has another IP and on that IP link when I click it opens a page with the kibana request a \*/\_search?pretty=" I wanted to know if I can make an API like this just with KIBANA

I do not know what "it has another IP" means or what its impact is? Perhaps that is the elasticsearch IP?

I also do not know what "make an API like this just with KIBANA" means sorry I just do not understand,

If I go back to your 1st post that Code is Elasticsearch DSL and no there is no documented Kibana API to just pass through Elasticsearch DSL [`_search` endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html) through Kibana if that is what you are asking

1st What version are you on?

2nd What kind of Visualization?

3rd is that the full request `*/_search?pretty=" ` the [`_search` endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html) is an Elasticsearch Endpoint, not a Kibana API endpoint. There is no equivalent in Kibana API

If you are writing a script to scrape data from the Kibana web app, I do not think I can help/have the expertise.

The proper way to get data from Elasticsearch / Kibana is

[Elasticsearch APIs](https://www.elastic.co/guide/en/elasticsearch/reference/current/rest-apis.html) this is where the `_search` endpoint lives

[Kibana APIs](https://www.elastic.co/guide/en/kibana/current/api.html)

[Kibana report Generations](https://www.elastic.co/guide/en/kibana/current/reporting-getting-started.html)

Downloading CSV data from Tables or Discover etc in Kibana

Perhaps if you have access to Kibana you can create Data Tables with the Same Aggregations and download the data from that.

Let me know what you think...

---

<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 2, 2024, 3:26pm UTC](https://discuss.elastic.co/t/how-i-put-a-response-into-a-kibana-url/350410/5 "2024-02-02T15:26:00Z")

</div>

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