# How to get Json data from elastic through URL?

**URL:** <https://discuss.elastic.co/t/how-to-get-json-data-from-elastic-through-url/77666>\
**Category:** Elasticsearch\
**Created:** [March 7, 2017, 1:23pm UTC](https://discuss.elastic.co/t/how-to-get-json-data-from-elastic-through-url/77666 "2017-03-07T13:23:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![varun1992](https://avatars.discourse-cdn.com/v4/letter/v/3da27b/32.png) [@varun1992](https://discuss.elastic.co/u/varun1992)\
**Post date:** [March 7, 2017, 1:23pm UTC](https://discuss.elastic.co/t/how-to-get-json-data-from-elastic-through-url/77666/1 "2017-03-07T13:23:29Z")

</div>

Sir,

I am using a report generating application. I want to get data from elastic and create report.

I tried to connect to elastic as a data source through basic http authentiction But i got an authentication error.  
([http://elastic:changeme@localhost:9200/csv/\_search?pretty=1&size=65](http://elastic:changeme@localhost:9200/csv/_search?pretty=1&size=65))

When I tried the same by disabling X-pack, I got Json data.

So how can i get Json data from elastic to 3rd party application with X-pack?

---

<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:** [March 7, 2017, 2:40pm UTC](https://discuss.elastic.co/t/how-to-get-json-data-from-elastic-through-url/77666/2 "2017-03-07T14:40:43Z")

</div>

Moved to #x-pack

---

<div class="post-metadata">

**Author:** ![varun1992](https://avatars.discourse-cdn.com/v4/letter/v/3da27b/32.png) [@varun1992](https://discuss.elastic.co/u/varun1992)\
**Post date:** [March 7, 2017, 3:34pm UTC](https://discuss.elastic.co/t/how-to-get-json-data-from-elastic-through-url/77666/3 "2017-03-07T15:34:10Z")

</div>

Sorry, i didn't understand. I am already using x-pack

---

<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:** [March 7, 2017, 4:03pm UTC](https://discuss.elastic.co/t/how-to-get-json-data-from-elastic-through-url/77666/4 "2017-03-07T16:03:27Z")

</div>

I just moved your question to #x-pack group instead of #elasticsearch where you initially posted it. That was not an answer 🙂

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 7, 2017, 6:34pm UTC](https://discuss.elastic.co/t/how-to-get-json-data-from-elastic-through-url/77666/5 "2017-03-07T18:34:23Z")

</div>

Hey,

if you install xpack, the security feature is enabled by default - thus you need to authenticate. If you dont want to do that, you can set `xpack.security.enabled: false` and you are good to go.

--Alex

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [March 7, 2017, 6:46pm UTC](https://discuss.elastic.co/t/how-to-get-json-data-from-elastic-through-url/77666/6 "2017-03-07T18:46:58Z")

</div>

> [@varun1992](#):
>
> [http://elastic:changeme@localhost:9200/csv/\_search?pretty=1&size=65](http://elastic:changeme@localhost:9200/csv/_search?pretty=1&size=65)

When you include the username and password in the URL, it is the client's job to process it and turn it into a Basic authentication header in the HTTP request.

That is, the `elastic:changeme` part of your URL never gets sent directly to Elasticsearch, but need to be specially handled within your 3rd party application.

If you paste that URL into curl you should find that it works fine.  
e.g. I just ran `curl --verbose 'http://elastic:changeme@localhost:9200/'` and got the correct result, because curl is handling the embedded parameters.

My best guess is that your 3rd party application does not handling embedded username+password in URLs. You will need to talk to the vendor of that application about that.

---

<div class="post-metadata">

**Author:** ![varun1992](https://avatars.discourse-cdn.com/v4/letter/v/3da27b/32.png) [@varun1992](https://discuss.elastic.co/u/varun1992)\
**Post date:** [March 8, 2017, 1:22pm UTC](https://discuss.elastic.co/t/how-to-get-json-data-from-elastic-through-url/77666/7 "2017-03-08T13:22:19Z")

</div>

Okay. Thanks for help

---

<div class="post-metadata">

**Author:** ![varun1992](https://avatars.discourse-cdn.com/v4/letter/v/3da27b/32.png) [@varun1992](https://discuss.elastic.co/u/varun1992)\
**Post date:** [March 8, 2017, 1:29pm UTC](https://discuss.elastic.co/t/how-to-get-json-data-from-elastic-through-url/77666/8 "2017-03-08T13:29:13Z")

</div>

Thanks for help. I need to check that

---

<div class="post-metadata">

**Author:** ![varun1992](https://avatars.discourse-cdn.com/v4/letter/v/3da27b/32.png) [@varun1992](https://discuss.elastic.co/u/varun1992)\
**Post date:** [March 8, 2017, 1:29pm UTC](https://discuss.elastic.co/t/how-to-get-json-data-from-elastic-through-url/77666/9 "2017-03-08T13:29:43Z")

</div>

Okay. Thanks

---

<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:** [April 5, 2017, 1:29pm UTC](https://discuss.elastic.co/t/how-to-get-json-data-from-elastic-through-url/77666/10 "2017-04-05T13:29:59Z")

</div>

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