Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54340,6 +54340,16 @@ components:
description: Name of the environment variable or secret that holds the username (used when `auth_strategy` is `plain`).
example: HTTP_AUTH_USERNAME
type: string
valid_tokens:
description: |-
A list of tokens that are accepted for authenticating incoming HTTP requests. When set,
the source rejects any request whose token does not match an enabled entry in this list.
Cannot be combined with the `plain` auth strategy.
items:
$ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidToken"
maxItems: 1000
minItems: 1
type: array
required:
- id
- type
Expand All @@ -54365,6 +54375,55 @@ components:
type: string
x-enum-varnames:
- HTTP_SERVER
ObservabilityPipelineHttpServerSourceValidToken:
description: An accepted token used to authenticate incoming HTTP server requests.
properties:
enabled:
default: true
description: |-
Indicates whether this token is currently accepted. Disabled tokens are rejected without
being removed from the configuration.
example: true
type: boolean
field_to_add:
$ref: "#/components/schemas/ObservabilityPipelineSourceValidTokenFieldToAdd"
path_to_token:
$ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToToken"
token_key:
description: Name of the environment variable or secret that holds the expected token value.
example: HTTP_SERVER_TOKEN
pattern: "^[A-Za-z0-9_]+$"
type: string
required:
- token_key
type: object
ObservabilityPipelineHttpServerSourceValidTokenPathToToken:
description: |-
Specifies where the worker extracts the token from in the incoming HTTP request.
This can be either a built-in location (`path` or `address`) or an HTTP header object.
oneOf:
- $ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation"
- $ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader"
ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader:
description: Extract the token from a specific HTTP request header.
properties:
header:
description: The name of the HTTP header that carries the token.
example: X-Token
type: string
required:
- header
type: object
ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation:
description: Built-in token location on the incoming HTTP request.
enum:
- path
- address
example: path
type: string
x-enum-varnames:
- PATH
- ADDRESS
ObservabilityPipelineKafkaDestination:
description: |-
The `kafka` destination sends logs to Apache Kafka topics.
Expand Down Expand Up @@ -56388,6 +56447,27 @@ components:
type: string
x-enum-varnames:
- SOCKET
ObservabilityPipelineSourceValidTokenFieldToAdd:
description: |-
An optional metadata field that is attached to every event authenticated by the
associated token. Both `key` and `value` must match `^[A-Za-z0-9_]+$`.
properties:
key:
description: The metadata field name to add to incoming events.
example: token_name
maxLength: 256
pattern: "^[A-Za-z0-9_]+$"
type: string
value:
description: The metadata field value to add to incoming events.
example: my_token
maxLength: 1024
pattern: "^[A-Za-z0-9_]+$"
type: string
required:
- key
- value
type: object
ObservabilityPipelineSpec:
description: Input schema representing an observability pipeline configuration. Used in create and validate requests.
properties:
Expand Down Expand Up @@ -56584,6 +56664,15 @@ components:
$ref: "#/components/schemas/ObservabilityPipelineTls"
type:
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecSourceType"
valid_tokens:
description: |-
A list of tokens that are accepted for authenticating incoming HEC requests. When set, the source
rejects any request whose HEC token does not match an enabled entry in this list.
items:
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecSourceValidToken"
maxItems: 1000
minItems: 1
type: array
required:
- id
- type
Expand All @@ -56598,6 +56687,26 @@ components:
type: string
x-enum-varnames:
- SPLUNK_HEC
ObservabilityPipelineSplunkHecSourceValidToken:
description: An accepted HEC token used to authenticate incoming Splunk HEC requests.
properties:
enabled:
default: true
description: |-
Indicates whether this token is currently accepted. Disabled tokens are rejected without
being removed from the configuration.
example: true
type: boolean
field_to_add:
$ref: "#/components/schemas/ObservabilityPipelineSourceValidTokenFieldToAdd"
token_key:
description: Name of the environment variable or secret that holds the expected HEC token value.
example: SPLUNK_HEC_TOKEN
pattern: "^[A-Za-z0-9_]+$"
type: string
required:
- token_key
type: object
ObservabilityPipelineSplunkTcpSource:
description: |-
The `splunk_tcp` source receives logs from a Splunk Universal Forwarder over TCP.
Expand Down
102 changes: 102 additions & 0 deletions examples/v2/observability-pipelines/ValidatePipeline_1130701356.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// Validate an observability pipeline with Splunk HEC source valid_tokens returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ObservabilityPipelinesApi;
import com.datadog.api.client.v2.model.ObservabilityPipelineConfig;
import com.datadog.api.client.v2.model.ObservabilityPipelineConfigDestinationItem;
import com.datadog.api.client.v2.model.ObservabilityPipelineConfigProcessorGroup;
import com.datadog.api.client.v2.model.ObservabilityPipelineConfigProcessorItem;
import com.datadog.api.client.v2.model.ObservabilityPipelineConfigSourceItem;
import com.datadog.api.client.v2.model.ObservabilityPipelineDataAttributes;
import com.datadog.api.client.v2.model.ObservabilityPipelineDatadogLogsDestination;
import com.datadog.api.client.v2.model.ObservabilityPipelineDatadogLogsDestinationType;
import com.datadog.api.client.v2.model.ObservabilityPipelineFilterProcessor;
import com.datadog.api.client.v2.model.ObservabilityPipelineFilterProcessorType;
import com.datadog.api.client.v2.model.ObservabilityPipelineSourceValidTokenFieldToAdd;
import com.datadog.api.client.v2.model.ObservabilityPipelineSpec;
import com.datadog.api.client.v2.model.ObservabilityPipelineSpecData;
import com.datadog.api.client.v2.model.ObservabilityPipelineSplunkHecSource;
import com.datadog.api.client.v2.model.ObservabilityPipelineSplunkHecSourceType;
import com.datadog.api.client.v2.model.ObservabilityPipelineSplunkHecSourceValidToken;
import com.datadog.api.client.v2.model.ValidationResponse;
import java.util.Arrays;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
ObservabilityPipelinesApi apiInstance = new ObservabilityPipelinesApi(defaultClient);

ObservabilityPipelineSpec body =
new ObservabilityPipelineSpec()
.data(
new ObservabilityPipelineSpecData()
.attributes(
new ObservabilityPipelineDataAttributes()
.config(
new ObservabilityPipelineConfig()
.destinations(
Collections.singletonList(
new ObservabilityPipelineConfigDestinationItem(
new ObservabilityPipelineDatadogLogsDestination()
.id("datadog-logs-destination")
.inputs(
Collections.singletonList(
"my-processor-group"))
.type(
ObservabilityPipelineDatadogLogsDestinationType
.DATADOG_LOGS))))
.processorGroups(
Collections.singletonList(
new ObservabilityPipelineConfigProcessorGroup()
.enabled(true)
.id("my-processor-group")
.include("service:my-service")
.inputs(
Collections.singletonList("splunk-hec-source"))
.processors(
Collections.singletonList(
new ObservabilityPipelineConfigProcessorItem(
new ObservabilityPipelineFilterProcessor()
.enabled(true)
.id("filter-processor")
.include("status:error")
.type(
ObservabilityPipelineFilterProcessorType
.FILTER))))))
.sources(
Collections.singletonList(
new ObservabilityPipelineConfigSourceItem(
new ObservabilityPipelineSplunkHecSource()
.id("splunk-hec-source")
.type(
ObservabilityPipelineSplunkHecSourceType
.SPLUNK_HEC)
.validTokens(
Arrays.asList(
new ObservabilityPipelineSplunkHecSourceValidToken()
.tokenKey("SPLUNK_HEC_TOKEN")
.enabled(true)
.fieldToAdd(
new ObservabilityPipelineSourceValidTokenFieldToAdd()
.key("token_name")
.value("primary_token")),
new ObservabilityPipelineSplunkHecSourceValidToken()
.tokenKey("SPLUNK_HEC_TOKEN_BACKUP")
.enabled(false)))))))
.name("Pipeline with Splunk HEC valid_tokens"))
.type("pipelines"));

try {
ValidationResponse result = apiInstance.validatePipeline(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ObservabilityPipelinesApi#validatePipeline");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Loading
Loading