# HTTP Request and Find a way in JAVA SCRIPT to get CONTENT from Kibana

**URL:** <https://discuss.elastic.co/t/http-request-and-find-a-way-in-java-script-to-get-content-from-kibana/129717>\
**Category:** Elasticsearch\
**Created:** [April 26, 2018, 3:41pm UTC](https://discuss.elastic.co/t/http-request-and-find-a-way-in-java-script-to-get-content-from-kibana/129717 "2018-04-26T15:41:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mas](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@Mas](https://discuss.elastic.co/u/Mas)\
**Post date:** [April 26, 2018, 3:41pm UTC](https://discuss.elastic.co/t/http-request-and-find-a-way-in-java-script-to-get-content-from-kibana/129717/1 "2018-04-26T15:41:37Z")

</div>

## I need to use an HTTP Request and Find a way in JAVA SCRIPTt to get CONTENT from Kibana I need and want almost this similar thing:

var my\_content\_from\_file = file\_content(ext + file\_name)  
out(my\_content\_from\_file)

//I have to find a way to get CONTENT from Kibana

/\*  
curl -XGET "[https://87b256626e4ad11cd37ac6d84dcba640.us-east-1.aws.found.io:9243/strokes\_000000785\_sherry\_003/\_search](https://87b256626e4ad11cd37ac6d84dcba640.us-east-1.aws.found.io:9243/strokes_000000785_sherry_003/_search)" -H 'Content-Type: application/json' -d' { "query": { "match\_all": {} } }'  
\*/

//I need to find and write an HTTP Request

## var my\_content\_from\_elasticsearch\_response = "?" out(my\_content\_from\_elasticsearch\_response)

I know there is a simple code in "JAVA!!" not java script like here:

* * *

GetRequest get = new GetRequest(queryString);

//HARD PART - NEED TO INCLUDE USERNAME AND PASSWORD  
get.addUser("sabzshop@gmail.com", "mypassword");  
get.send();

println("Reponse Content: " + get.getContent());

## String content = get.getContent(); JSONObject response = parseJSONObject(content); return response;

what should I do?  
Do you have any similar experience in this area?  
thank youvery much and appreciate for your attention.  
Sincerely yours,  
Mas Hei  
[sabzshop@gmail.com](mailto:sabzshop@gmail.com)  
[mass\_sabz@yahoo.com](mailto:mass_sabz@yahoo.com)

---

<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 24, 2018, 3:41pm UTC](https://discuss.elastic.co/t/http-request-and-find-a-way-in-java-script-to-get-content-from-kibana/129717/2 "2018-05-24T15:41:43Z")

</div>

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