Finally I've used a simple Apache HttpClient and can use the InputStream to
treat it without spend memory.
RequestConfig requestConfig =
> RequestConfig.custom().setConnectTimeout(10000).setSocketTimeout(10000).build();
> HttpClient httpClient =
> HttpClientBuilder.create().setDefaultRequestConfig(requestConfig).build();
> String uri = "http://192.168.1.248:12900/search/universal/absolute";
> uri = uri + "?query=" + urlencodedQuey;
> uri = uri + "&from=1980-01-01%2000%3A00%3A00"; //colon and space
> must be encoded...
> uri = uri + "&to=2030-01-01%2000%3A00%3A00";
> uri = uri + "&fields=timestamp,thread,level,logger,message";
> String plainCreds = "user:password";
> byte[] base64CredsBytes = Base64.encodeBase64(plainCreds
> .getBytes());
> String base64Creds = new String(base64CredsBytes);
> HttpGet httpGet = new HttpGet(uri);
> httpGet.setHeader("Authorization", "Basic " + base64Creds);
> httpGet.setHeader("Accept", "text/csv");
> HttpResponse httpResponse = httpClient.execute(httpGet);
> InputStream input = httpResponse.getEntity().getContent();
On Sunday, May 17, 2015 at 5:49:00 PM UTC+2, [email protected] wrote:
>
> Has anybody a sample to download a CSV from the server query API?
>
> http://graylogserver:12900/search/universal/absolute in CSV format
>
>
--
You received this message because you are subscribed to the Google Groups
"graylog2" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.