HTTP source API documentation
Is there HTTP source API documentation?
I can find doc to upload data to an HTTP source at https://service.sumologic.com/ui/help/Default.htm#Uploading_Files_to_an_HTTP_Source.htm.
But it doesn't mention anything about HTTP status code and response.
-
Is this what you're looking for? https://github.com/SumoLogic/sumo-api-doc/wiki
-
I don't think so. The docs are for the Management, Search and Dashboard APIs.
I'm looking for doc for the HTTP source API to send logs to sumologic.Here is a background story. We use fluentd and fluent-plugin-sumologic to collect logs from all servers and send some logs to sumologic.
http://www.fluentd.org/
https://github.com/memorycraft/fluent-plugin-sumologicThe sumologic plugin doesn't check HTTP status as below. I just want to make sure if it's OK.
def write(chunk)
[snip]
http = Net::HTTP.new(@host, @port.to_i)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.set_debug_output $stderrrequest = Net::HTTP::Post.new(@path)
request.body = messages.join("\n")
http.request(request)
end -
hey Yuji - the documentation is indeed a bit cryptic.
i don't have a Ruby example handy, but it is really quite simple. just POST to the URL the UI gives you to copy when you create the HTTP source. so the Fluentd plugin code appears to be doing the right thing.
as you noticed, it doesn't check the result status code. that's a bit rough, actually. basically, it looks like it would silently fail if we don't return a 200.
i am going to dig into this a bit more. for now tho, it should work. but you will potentially lose messages without knowing.
chr.
-
here's status code you should expect:
401 on authentication errors
400 on bad requests, e.g. the stream is NOT in gzip format when Content-Type indicates so
429 on exceeding quota
503 when we need to do back pressure, or when the endpoint is in the middle of shutting down during a rolling restart
Please sign in to leave a comment.
Comments
5 comments