out_splunk: avoid retries for requests we know will fail (#2458)
out_splunk: avoid retries for requests we know will fail (#2458)

The Splunk HTTP Event Collector will return HTTP 4xx errors for
authorization, authentication, or bad payloads:

https://docs.splunk.com/Documentation/Splunk/8.0.5/Data/TroubleshootHTTPEventCollector#Possible_error_codes

(In my estimation, bad requests are most likely to occur when using the
Splunk_Send_Raw configuration option.)

At present Fluent Bit will retry these requests, but there is no point
in doing so -- they will always fail. Instead, mark them as failures
immediately.

This commit also simplifies the control flow for retries by using the
existing return code instead of a label & goto statements.

Signed-off-by: Aaron Jacobs <e0b65152f183aaa43851860717e607da9bc1afab@crescendotechnology.com>
nokute78/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit