sparkblaze
(Philip Widdowson)
December 12, 2017, 9:40am
1
Is there a proper way to troubleshoot what Graylog finds out from a Data Lookup? Graylog seems to return nothing when I run the test lookup, but the same query when run in a browser returns data:
[{"cn": "test-pc","dn":"cn=test-pc,dc=test,dc=domain,dc=local"}]
Data Lookup config:
Lookup URL: http://api.test.domain.local/api/v1/computers?q=cn:${key}&match=wildcard
Single value: $[0].cn
Multi value: $
I’ve tried a variety of different values for single value, the answer for single_value and multi_value is always ‘null’
EDIT: This might be because the URL requires authorization - are there any options to support authorization with Graylog Data Lookups?
kay
(Kay Roepke)
December 12, 2017, 10:25am
2
Hi!
I’ve just tried this locally and it works as expected:
The only difference is that I’m not using the ${key}
in the URL, since I’m just serving a static file from /tmp
.
Could the issue be an encoding problem, IOW are there any non-URL safe characters in the keys you are looking up?
jochen
(Jochen)
December 12, 2017, 10:27am
3
That’s currently not supported.
@Inject
protected HTTPJSONPathDataAdapter(@Assisted LookupDataAdapterConfiguration config,
@Assisted("id") String id,
@Assisted("name") String name,
Engine templateEngine,
OkHttpClient httpClient,
MetricRegistry metricRegistry) {
super(id, name, config, metricRegistry);
this.config = (Config) config;
this.templateEngine = templateEngine;
// TODO Add config options: caching, timeouts, custom headers, basic auth (See: https://github.com/square/okhttp/wiki/Recipes)
this.httpClient = httpClient.newBuilder().build(); // Copy HTTP client to be able to modify it
this.httpRequestTimer = metricRegistry.timer(MetricRegistry.name(getClass(), "httpRequestTime"));
this.httpRequestErrors = metricRegistry.meter(MetricRegistry.name(getClass(), "httpRequestErrors"));
this.httpURLErrors = metricRegistry.meter(MetricRegistry.name(getClass(), "httpURLErrors"));
}
@Override
protected void doStart() throws Exception {
if (isNullOrEmpty(config.url())) {
kay
(Kay Roepke)
December 12, 2017, 10:34am
4
Just saw your edit.
Apparently there is a problem with basic auth, by passing the username and password in the URL template.
I naively assumed it would work.
Could you open a bug report on https://github.com/Graylog2/graylog2-server/issues please?
Thanks!
system
(system)
Closed
December 26, 2017, 10:34am
5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.