Comments

5 comments

  • Avatar
    Yoway Buorn

    Is this what you're looking for? https://github.com/SumoLogic/sumo-api-doc/wiki

    0
    Comment actions Permalink
  • Avatar
    Yuji Yamano

    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-sumologic

    The sumologic plugin doesn't check HTTP status as below. I just want to make sure if it's OK.

    https://github.com/memorycraft/fluent-plugin-sumologic/blob/master/lib/fluent/plugin/out_sumologic.rb#L39-67

    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 $stderr

    request = Net::HTTP::Post.new(@path)

    request.body = messages.join("\n")

    http.request(request)

    end

    0
    Comment actions Permalink
  • Avatar
    Christian

    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.

     

    0
    Comment actions Permalink
  • Avatar
    Christian

    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

    0
    Comment actions Permalink
  • Avatar
    Yuji Yamano

    Thank you, Yoway and Christian. I just sent a pull request to the plugin author.

    0
    Comment actions Permalink

Please sign in to leave a comment.