ApiError HTTP 404 not found

Hi everyone,

I am new to graylog.

I must send data from my python app to graylog using GELF
I can access graylog through firefox but the url to access gelf is unaccessible.
I read the documentation to send gelf data and pretty much did it the way it is told to.
I tried through requests in python and through postman but the result is the always the same.

An http post on this https://mydomain/gelf gives me :

{
“type”: “ApiError”,
“message”: “HTTP 404 Not Found”
}

And an http get to https://mydomain/search gives a 202
If both didn’t work, I would understand, but having only the gelf endpoint not working is getting me confused

Is the url incorrect or is it the graylog configuration that is incorrect ?
I didn’t configure graylog myself, I just have access to one.
Any idea why I can’t access the gelf endpoint ?

May I suggest going back and re-reading the documentation. Because you obviously did not read it.

I have the choice between UDP, TCP and HTTP.
I was asked to send data through HTTP.

(httpsurl stands for https://mydomain since newcomers can only put 2 url in a post on the blog)

My payload is the following :

{
“version”: “1.1”,
“host”: “mydomain”,
“short_message”: “A short message that helps you identify what is going on”,
“full_message”: “Backtrace here\n\nmore stuff”,
“timestamp”: 1385053862.3072,
“level”: 1,
“_user_id”: 9001,
“_some_info”: “foo”,
“_some_env_var”: “bar”
}

Which I took from the GELF documentation but only changed the host value.

this is the curl request :

curl -X POST -H ‘Content-Type: application/json’ -d ‘{ “version”: “1.1”, “host”: “mydomain”, “short_message”: “A short message”, “level”: 5, “_some_info”: “foo” }’ ‘httpsurl/gelf’

and this is the python request I made using the requests library :

import requests

headers = {
‘Content-Type’: ‘application/json’,
}

data = ‘{ “version”: “1.1”, “host”: “mydomain”, “short_message”: “A short message”, “level”: 5, “_some_info”: “foo” }’

response = requests.post(‘httpsurl/gelf’, headers=headers, data=data)

And since it can be sent through curl -X POST i assumed that making a POST request with requests in python or a POST request through postman would work on httpsurl/gelf

Could you please tell me what is it that I don’t understand ?
This request returns a 404

Did you create a input in graylogs ui?

No I didn’t, I must register my application as an input provider in the graylog ui ?
And if so, could you tell me where is it explained ?

http://docs.graylog.org/en/3.0/pages/getting_started.html

Ok, I talked with my sysadmin and he created an input and now everything works.
Is there a way to send multiple gelf per request ? like a bulk request in elasticsearch ?
Because for now graylog receives 14000 gelf per minute.

And also, is there a way to clean the default index ? It is for testing purposes

Thanks for the answers

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