I am facing difficulties to fetch graylog api messages through curl command. Through API browser, I am able to retrieve messages via " [Search/Relative]: Message search" with below request url. But, i am facing difficulties to retrieve the same messages through curl command.
request url in api browser section::
http://<>:12900/search/universal/relative?query=CV547&range=86400&fields=message%2Csource
The user @graylogDev is not related to the Graylog Project or Company …
if you need time-sensitive support, please contact Graylog sales to get the official support that follows any kind of SLA.
For me the following is working:
curl -X GET "https://graylog.local.lan/graylog/api/search/universal/absolute?query=source%3Arpi.lan&from=2018-10-16T12%3A00%3A00.000Z&to=2018-10-16T16%3A00%3A00.000Z&fields=source%2cmessage"
It will return a json of the result and the requested fields. I have no authentication Information in this string because I use a Proxy that make use of the SSO Plugin to authenticate. You have the URL in the API Browser to be used - your formatting does not allow to debug whatever you try to say.
Do we have separate url’s for graylog dashboard and for API requests? . Currently, I am accessing the curl through dashboard url and the url which i got in the graylog rest api browser[search/relative:message search] request url section.
If we have separate url for API requests then please let me know how to get those link and to search the messages with it.
I got the issue, its due to ‘$’ character in password. It’s actually an issue with curl. I thought its due to some permissions or any issue with graylog API. But, finally it’s due special symbol in my password.
For the above url, i tried like below and able to get messages.
–user support_gray:leo/$123