Skip to content
Open
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
64 changes: 61 additions & 3 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43973,6 +43973,36 @@ components:
type: string
x-enum-varnames:
- ELASTICSEARCH
ObservabilityPipelineEnrichmentTableFieldEventLookup:
description: Specifies an event field path to use as the enrichment table lookup key.
properties:
event:
description: Path to the field in the log event.
example: log.user.id
type: string
required:
- event
type: object
ObservabilityPipelineEnrichmentTableFieldSecretLookup:
description: Specifies a secret reference to use as the enrichment table lookup key.
properties:
secret:
description: The name of the secret whose value is used as the lookup key.
example: LOOKUP_KEY_SECRET
type: string
required:
- secret
type: object
ObservabilityPipelineEnrichmentTableFieldVrlLookup:
description: Specifies a VRL expression to compute the enrichment table lookup key.
properties:
vrl:
description: A VRL expression that resolves to the lookup key value.
example: .user_id
type: string
required:
- vrl
type: object
ObservabilityPipelineEnrichmentTableFile:
description: Defines a static enrichment table loaded from a CSV file.
properties:
Expand Down Expand Up @@ -44023,6 +44053,18 @@ components:
type: string
x-enum-varnames:
- CSV
ObservabilityPipelineEnrichmentTableFileKeyItemField:
description: |-
Specifies the source of the key value used for enrichment table lookups.
Can be a plain field path string, or an object specifying the lookup type (`event`, `vrl`, or `secret`).
example: log.user.id
oneOf:
- description: A plain field path in the log event.
example: log.user.id
type: string
- $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFieldEventLookup"
- $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFieldVrlLookup"
- $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFieldSecretLookup"
ObservabilityPipelineEnrichmentTableFileKeyItems:
description: Defines how to map log fields to enrichment table columns during lookups.
properties:
Expand All @@ -44033,9 +44075,7 @@ components:
comparison:
$ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFileKeyItemsComparison"
field:
description: The `items` `field`.
example: log.user.id
type: string
$ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFileKeyItemField"
required:
- column
- comparison
Expand Down Expand Up @@ -47056,6 +47096,8 @@ components:
description: Name of the environment variable or secret that holds the Splunk HEC token.
example: SPLUNK_HEC_TOKEN
type: string
token_strategy:
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecDestinationTokenStrategy"
type:
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecDestinationType"
required:
Expand All @@ -47074,6 +47116,16 @@ components:
x-enum-varnames:
- JSON
- RAW_MESSAGE
ObservabilityPipelineSplunkHecDestinationTokenStrategy:
description: Controls how the Splunk HEC token is supplied. Use `custom` to provide a token via `token_key`, or `from_source` to forward the token received from an upstream Splunk HEC source.
enum:
- custom
- from_source
example: custom
type: string
x-enum-varnames:
- CUSTOM
- FROM_SOURCE
ObservabilityPipelineSplunkHecDestinationType:
default: splunk_hec
description: The destination type. Always `splunk_hec`.
Expand All @@ -47097,6 +47149,12 @@ components:
description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components).
example: splunk-hec-source
type: string
store_hec_token:
description: |-
When `true`, the Splunk HEC token from the incoming request is stored in the event.
This allows downstream components to forward the token to other Splunk HEC destinations.
example: true
type: boolean
tls:
$ref: "#/components/schemas/ObservabilityPipelineTls"
type:
Expand Down
35 changes: 35 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19527,6 +19527,27 @@ datadog\_api\_client.v2.model.observability\_pipeline\_elasticsearch\_destinatio
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_enrichment\_table\_field\_event\_lookup module
-----------------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_event_lookup
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_enrichment\_table\_field\_secret\_lookup module
------------------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_secret_lookup
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_enrichment\_table\_field\_vrl\_lookup module
---------------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_vrl_lookup
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_enrichment\_table\_file module
-------------------------------------------------------------------------------------

Expand All @@ -19548,6 +19569,13 @@ datadog\_api\_client.v2.model.observability\_pipeline\_enrichment\_table\_file\_
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_enrichment\_table\_file\_key\_item\_field module
-------------------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_key_item_field
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_enrichment\_table\_file\_key\_items module
-------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -20808,6 +20836,13 @@ datadog\_api\_client.v2.model.observability\_pipeline\_splunk\_hec\_destination\
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_splunk\_hec\_destination\_token\_strategy module
-------------------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination_token_strategy
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_splunk\_hec\_destination\_type module
--------------------------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
"""
Validate an observability pipeline with Splunk HEC destination token_strategy returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi
from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig
from datadog_api_client.v2.model.observability_pipeline_config_processor_group import (
ObservabilityPipelineConfigProcessorGroup,
)
from datadog_api_client.v2.model.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes
from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source import (
ObservabilityPipelineDatadogAgentSource,
)
from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source_type import (
ObservabilityPipelineDatadogAgentSourceType,
)
from datadog_api_client.v2.model.observability_pipeline_filter_processor import ObservabilityPipelineFilterProcessor
from datadog_api_client.v2.model.observability_pipeline_filter_processor_type import (
ObservabilityPipelineFilterProcessorType,
)
from datadog_api_client.v2.model.observability_pipeline_spec import ObservabilityPipelineSpec
from datadog_api_client.v2.model.observability_pipeline_spec_data import ObservabilityPipelineSpecData
from datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination import (
ObservabilityPipelineSplunkHecDestination,
)
from datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination_token_strategy import (
ObservabilityPipelineSplunkHecDestinationTokenStrategy,
)
from datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination_type import (
ObservabilityPipelineSplunkHecDestinationType,
)

body = ObservabilityPipelineSpec(
data=ObservabilityPipelineSpecData(
attributes=ObservabilityPipelineDataAttributes(
config=ObservabilityPipelineConfig(
destinations=[
ObservabilityPipelineSplunkHecDestination(
id="splunk-hec-destination",
inputs=[
"my-processor-group",
],
type=ObservabilityPipelineSplunkHecDestinationType.SPLUNK_HEC,
token_key="SPLUNK_HEC_TOKEN",
token_strategy=ObservabilityPipelineSplunkHecDestinationTokenStrategy.CUSTOM,
),
],
processor_groups=[
ObservabilityPipelineConfigProcessorGroup(
enabled=True,
id="my-processor-group",
include="service:my-service",
inputs=[
"datadog-agent-source",
],
processors=[
ObservabilityPipelineFilterProcessor(
enabled=True,
id="filter-processor",
include="status:error",
type=ObservabilityPipelineFilterProcessorType.FILTER,
),
],
),
],
sources=[
ObservabilityPipelineDatadogAgentSource(
id="datadog-agent-source",
type=ObservabilityPipelineDatadogAgentSourceType.DATADOG_AGENT,
),
],
),
name="Pipeline with Splunk HEC token_strategy",
),
type="pipelines",
),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = ObservabilityPipelinesApi(api_client)
response = api_instance.validate_pipeline(body=body)

print(response)
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
"""
Validate an observability pipeline with Splunk HEC source store_hec_token returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi
from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig
from datadog_api_client.v2.model.observability_pipeline_config_processor_group import (
ObservabilityPipelineConfigProcessorGroup,
)
from datadog_api_client.v2.model.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes
from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination import (
ObservabilityPipelineDatadogLogsDestination,
)
from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination_type import (
ObservabilityPipelineDatadogLogsDestinationType,
)
from datadog_api_client.v2.model.observability_pipeline_filter_processor import ObservabilityPipelineFilterProcessor
from datadog_api_client.v2.model.observability_pipeline_filter_processor_type import (
ObservabilityPipelineFilterProcessorType,
)
from datadog_api_client.v2.model.observability_pipeline_spec import ObservabilityPipelineSpec
from datadog_api_client.v2.model.observability_pipeline_spec_data import ObservabilityPipelineSpecData
from datadog_api_client.v2.model.observability_pipeline_splunk_hec_source import ObservabilityPipelineSplunkHecSource
from datadog_api_client.v2.model.observability_pipeline_splunk_hec_source_type import (
ObservabilityPipelineSplunkHecSourceType,
)

body = ObservabilityPipelineSpec(
data=ObservabilityPipelineSpecData(
attributes=ObservabilityPipelineDataAttributes(
config=ObservabilityPipelineConfig(
destinations=[
ObservabilityPipelineDatadogLogsDestination(
id="datadog-logs-destination",
inputs=[
"my-processor-group",
],
type=ObservabilityPipelineDatadogLogsDestinationType.DATADOG_LOGS,
),
],
processor_groups=[
ObservabilityPipelineConfigProcessorGroup(
enabled=True,
id="my-processor-group",
include="service:my-service",
inputs=[
"splunk-hec-source",
],
processors=[
ObservabilityPipelineFilterProcessor(
enabled=True,
id="filter-processor",
include="status:error",
type=ObservabilityPipelineFilterProcessorType.FILTER,
),
],
),
],
sources=[
ObservabilityPipelineSplunkHecSource(
id="splunk-hec-source",
type=ObservabilityPipelineSplunkHecSourceType.SPLUNK_HEC,
store_hec_token=True,
),
],
),
name="Pipeline with Splunk HEC store_hec_token",
),
type="pipelines",
),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = ObservabilityPipelinesApi(api_client)
response = api_instance.validate_pipeline(body=body)

print(response)
Loading
Loading