Skip to content

[splunkhecreceiver] hec receiver handle raw should return JSON ok response #29745

Closed
@splunkericl

Description

@splunkericl

Describe the bug
splunkhecreceiver has an endpoint /services/collector/raw. When ingest data successfully, it writes 200 http response wihtout http response body. This is inconsistent with the splunk enterprise/cloud behavior.

its sibling endpoint /services/collector/ returns http json response as well so it is also inconsistent.

Steps to reproduce
ingest an event log with /services/collector/raw endpoint:

curl --location 'localhost:8088/services/collector/raw?sourcetype=eric_test&index=main&source=postman' \
--header 'Content-Type: application/json' \
--data 'event1
event3'

What did you expect to see?
http json response with 200 status:

{
    "text": "Success",
    "code": 0
}

What did you see instead?
empty http response with 200 status

What version did you use?
Version: latest

What config did you use?
Config: any configs that spawn a hecreceiver

Additional context
essentially handleRawReq needs to write success response body here: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/splunkhecreceiver/receiver.go#L295

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions