API'S

Hello All,
Can we use Java to only read data from elasticsearch that we are already ingested logs file to elasticsearch?
not to index from java and retrieving, only to read already created logs file's instead of kibana to get as JSON from java?

or else any other way?

Yes.

Although I'm not quite I understood what you meant by "read data from elasticsearch"...

Do you mean search? To you mean extract all data that matches a search?
Anyway, this is all possible with the Java Rest Client.

what exactly is
i have ingested logs to elasticsearch through logstash and that logs can be viewed using java?(springboot) or anything else? without kibana

Yes.

can you explain in details? by which
in tutorial i have shown only springboot with elasticsearch to index our document and retriveing?

how can we view logs? that are already stored?

public class App {
    public static void main(String[] args) throws IOException {
        RestHighLevelClient client = new RestHighLevelClient(
                RestClient.builder(HttpHost.create("http://localhost:9200")));

        SearchResponse response = client.search(new SearchRequest(), RequestOptions.DEFAULT);

        System.out.println("response = " + response);

        client.close();
    }
}

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