Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SplunkHecReceiver] Align receiver errors messages to splunk enterprise #19219

Closed
6 tasks
splunkericl opened this issue Mar 4, 2023 · 11 comments
Closed
6 tasks

Comments

@splunkericl
Copy link
Contributor

splunkericl commented Mar 4, 2023

Is your feature request related to a problem? Please describe.
Currently the HEC receiver error messages and HTTP status code is different than splunk enterprise.

Status Code + Message Splunk Enterprise Otel HEC Receiver Explanation
200 Success X X  
403 Token disabled X   Token management is not supported on EP.
401 Token is required X   Token validation is not supported on EP.
401 Invalid authorization X   Token validation is not supported on EP.
403 Invalid token X   Token validation is not supported on EP.
400 No data X   We can contribute back to otel.
400 Invalid data format X   We can contribute back to otel.
400 Incorrect Index X   This requires EP to fetch information about supported index configured for the HEC token from Splunk, which isn’t supported.
500 Internal server error X X  
503 Server is busy X    
400 Data channel is missing X   Data channel is used for ack.
400 Invalid data channel X   Data channel is used for ack.
400 Event field is required X   Receiver will just respond with ‘failed to unmarshall data’ with 400
400 Event field cannot be blank X   Receiver will just respond with ‘failed to unmarshall data’ with 400
400 ACK is disabled X   Ack is not supported
400 Error in handling indexed fields X X  
400 Query string authorization is not enabled X   Query string authorization not supported on receiver

Describe the solution you'd like
Some of the HTTP responses should be implemented:

  • 400 No data
  • 400 Invalid Data Format
  • 400 Event field is required
  • 400 Event field cannot be blank
  • 400 ACK is disabled
  • 400 Querey string authorization is not enabled

Describe alternatives you've considered
N/A

@bogdandrutu bogdandrutu transferred this issue from open-telemetry/opentelemetry-collector Mar 6, 2023
@atoulme atoulme assigned atoulme and unassigned atoulme Mar 7, 2023
@atoulme
Copy link
Contributor

atoulme commented Mar 7, 2023

What does no data mean? An empty HTTP request or a request with no event? What is the difference between "no data" and "invalid data format"?

What exactly is the format of the response? Can you give an example?

@splunkericl
Copy link
Contributor Author

yeah there is more documentation on the endpoint page.

But for splunk enterprise, the "No data" error is returned if the payload is rejected. This can be because the payload has invalid quotes. In the context of SplunkHECReceiver, it might be more fitting to return "Invalid Data Format" instead since this is just a decoding problem.

The http response status code would be 400 and its body would look like:

{"text":"Invalid data format","code":6}

@atoulme
Copy link
Contributor

atoulme commented Mar 7, 2023

Is the code 6 attribute defined somewhere?

@splunkericl
Copy link
Contributor Author

yeah it is defined in the response documentation on the page (expand under "Send events to the HTTP Event Collector.").

0 200 OK Success
1 403 Forbidden Token disabled
2 401 Unauthorized Token is required
3 401 Unauthorized Invalid authorization
4 403 Forbidden Invalid token
5 400 Bad Request No data
6 400 Bad Request Invalid data format
7 400 Bad Request Incorrect index
8 500 Internal Error Internal server error
9 503 Service Unavailable Server is busy
10 400 Bad Request Data channel is missing
11 400 Bad Request Invalid data channel
12 400 Bad Request Event field is required
13 400 Bad Request Event field cannot be blank
14 400 Bad Request ACK is disabled
15 400 Bad Request Error in handling indexed fields
16 400 Bad Request Query string authorization is not enabled

@timannguyen
Copy link
Contributor

@atoulme i will be working on this.

@timannguyen
Copy link
Contributor

timannguyen commented Mar 17, 2023

400 ACK is disabled is a splunk indexer feature that the receiver cannot be validate the token. so it will not be implemented.

@timannguyen
Copy link
Contributor

Query string authorization is not enabled is also splunk indexer only feature to use token in query param. this will not be implemented.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label May 17, 2023
@splunkericl
Copy link
Contributor Author

Re-commenting this thread again as one of the user runs into this problem. the HTTP client is expecting a json response like {"text": "Success", "code": 0} when hec receiver returns OK.

We can work on this so customers moving from Splunk HEC to EP HEC doesn't have to make any changes.

@github-actions github-actions bot removed the Stale label Jul 8, 2023
dmitryax pushed a commit that referenced this issue Aug 1, 2023
…#24604)

**Description:** Changed `200` response body from plaintext to JSON
object: `"OK"` → `{"text": "Success", "code": 0}`.

**Testing:** Updated existing unit tests to reflect the new response
body. Everything passes as expected.

**Documentation:**
https://docs.splunk.com/Documentation/Splunk/9.0.4/RESTREF/RESTinput

**Link to Tracking Issue:** #19219
@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Sep 7, 2023
Copy link
Contributor

github-actions bot commented Nov 6, 2023

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants