# Wrong hostname provide by GUI for curl command

**URL:** <https://discuss.elastic.co/t/wrong-hostname-provide-by-gui-for-curl-command/189015>\
**Category:** Kibana\
**Created:** [July 5, 2019, 6:31am UTC](https://discuss.elastic.co/t/wrong-hostname-provide-by-gui-for-curl-command/189015 "2019-07-05T06:31:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ian\_Jarvis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ian_jarvis/32/49478_2.png) [@Ian\_Jarvis](https://discuss.elastic.co/u/Ian_Jarvis)\
**Post date:** [July 5, 2019, 6:31am UTC](https://discuss.elastic.co/t/wrong-hostname-provide-by-gui-for-curl-command/189015/1 "2019-07-05T06:31:27Z")

</div>

Hi

I'm trying to use curl to pull data from my indices however the Dev Tools console in Kibana does not provide the correct hostname when I use the "Copy as cURL" option.

I can set up a search in Kibana Dev Tools like so:

POST ens-status-\*/\_search  
{  
"query": {  
"bool": {  
"should": [  
{  
"match\_phrase": {  
"customerId": "TESCO"  
}  
}  
],  
"minimum\_should\_match": 1,  
"filter": {  
"range": {  
"@timestamp": {  
"from": "now-30m",  
"to": "now"  
}  
}  
}  
}  
}  
}

And this works absolutely fine and provides the data I need. However, when I then select the spanner (wrench) symbol and choose the Copy as cURL option, it provides me a curl command as follows, which seems to reference a container host, rather than a real host that resolves correctly:

curl -XPOST "[http://73b15f5b7bb104552a4beeb41bd3a9bb5ec.containerhost:9244/ens-status-\*/\_search](http://73b15f5b7bb104552a4beeb41bd3a9bb5ec.containerhost:9244/ens-status-*/_search)" -H 'Content-Type: application/json' -d'  
{  
"query": {  
"bool": {  
"should": [  
{  
"match\_phrase": {  
"customerId": "TESCO"  
}  
}  
],  
"minimum\_should\_match": 1,  
"filter": {  
"range": {  
"@timestamp": {  
"from": "now-30m",  
"to": "now"  
}  
}  
}  
}  
}  
}'

Any ideas why this is the case?

Thanks in advance

Ian Jarvis

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 5, 2019, 6:45am UTC](https://discuss.elastic.co/t/wrong-hostname-provide-by-gui-for-curl-command/189015/2 "2019-07-05T06:45:20Z")

</div>

It's because Kibana only knows that URL (inside the container).  
If you run Kibana outside (on the host) then the url will be ok.

---

<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:** [August 2, 2019, 6:59am UTC](https://discuss.elastic.co/t/wrong-hostname-provide-by-gui-for-curl-command/189015/3 "2019-08-02T06:59:02Z")

</div>

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