Skip to content

Commit a521805

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add decoder processor to public api (#2513)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 101b012 commit a521805

File tree

13 files changed

+399
-2
lines changed

13 files changed

+399
-2
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "04d09cb",
3-
"generated": "2025-07-23 09:23:52.685"
2+
"spec_repo_commit": "4727afe",
3+
"generated": "2025-07-23 15:37:34.194"
44
}

.generator/schemas/v1/openapi.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5547,6 +5547,72 @@ components:
55475547
type: string
55485548
x-enum-varnames:
55495549
- DATE_REMAPPER
5550+
LogsDecoderProcessor:
5551+
description: 'The decoder processor decodes any source attribute containing
5552+
a
5553+
5554+
base64/base16-encoded UTF-8/ASCII string back to its original value, storing
5555+
the
5556+
5557+
result in a target attribute.'
5558+
properties:
5559+
binary_to_text_encoding:
5560+
$ref: '#/components/schemas/LogsDecoderProcessorBinaryToTextEncoding'
5561+
input_representation:
5562+
$ref: '#/components/schemas/LogsDecoderProcessorInputRepresentation'
5563+
is_enabled:
5564+
default: false
5565+
description: Whether the processor is enabled.
5566+
type: boolean
5567+
name:
5568+
description: Name of the processor.
5569+
type: string
5570+
source:
5571+
description: Name of the log attribute with the encoded data.
5572+
example: encoded.field
5573+
type: string
5574+
target:
5575+
description: Name of the log attribute that contains the decoded data.
5576+
example: decoded.field
5577+
type: string
5578+
type:
5579+
$ref: '#/components/schemas/LogsDecoderProcessorType'
5580+
required:
5581+
- source
5582+
- target
5583+
- binary_to_text_encoding
5584+
- input_representation
5585+
- type
5586+
type: object
5587+
LogsDecoderProcessorBinaryToTextEncoding:
5588+
description: The encoding used to represent the binary data.
5589+
enum:
5590+
- base64
5591+
- base16
5592+
example: base64
5593+
type: string
5594+
x-enum-varnames:
5595+
- BASE64
5596+
- BASE16
5597+
LogsDecoderProcessorInputRepresentation:
5598+
description: The original representation of input string.
5599+
enum:
5600+
- utf_8
5601+
- integer
5602+
example: utf_8
5603+
type: string
5604+
x-enum-varnames:
5605+
- UTF_8
5606+
- INTEGER
5607+
LogsDecoderProcessorType:
5608+
default: decoder-processor
5609+
description: Type of logs decoder processor.
5610+
enum:
5611+
- decoder-processor
5612+
example: decoder-processor
5613+
type: string
5614+
x-enum-varnames:
5615+
- DECODER_PROCESSOR
55505616
LogsExclusion:
55515617
description: Represents the index exclusion filter object from configuration
55525618
API.
@@ -6215,6 +6281,7 @@ components:
62156281
- $ref: '#/components/schemas/LogsTraceRemapper'
62166282
- $ref: '#/components/schemas/LogsSpanRemapper'
62176283
- $ref: '#/components/schemas/LogsArrayProcessor'
6284+
- $ref: '#/components/schemas/LogsDecoderProcessor'
62186285
LogsQueryCompute:
62196286
description: Define computation for a log query.
62206287
properties:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-07-22T13:27:59.975Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"log": {
3+
"_recordingName": "Logs Pipelines/Create a pipeline with Decoder Processor returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "728a82ed3e812a075bff989367bf7d5f",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 276,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 574,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"filter\":{\"query\":\"source:python\"},\"name\":\"testDecoderProcessor\",\"processors\":[{\"binary_to_text_encoding\":\"base16\",\"input_representation\":\"utf_8\",\"is_enabled\":true,\"name\":\"test_decoder\",\"source\":\"encoded.field\",\"target\":\"decoded.field\",\"type\":\"decoder-processor\"}],\"tags\":[]}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/logs/config/pipelines"
39+
},
40+
"response": {
41+
"bodySize": 365,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 365,
45+
"text": "{\"id\":\"BEg5CcvmSfyIGoMi9PWyTQ\",\"type\":\"pipeline\",\"name\":\"testDecoderProcessor\",\"is_enabled\":false,\"is_read_only\":false,\"filter\":{\"query\":\"source:python\"},\"processors\":[{\"name\":\"test_decoder\",\"is_enabled\":true,\"source\":\"encoded.field\",\"target\":\"decoded.field\",\"binary_to_text_encoding\":\"base16\",\"input_representation\":\"utf_8\",\"type\":\"decoder-processor\"}],\"tags\":[]}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 702,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2025-07-22T12:57:10.803Z",
61+
"time": 425
62+
},
63+
{
64+
"_id": "eb454a5f3982ee2abefb92c5980ba3f3",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 0,
69+
"cookies": [],
70+
"headers": [
71+
{
72+
"_fromType": "array",
73+
"name": "accept",
74+
"value": "*/*"
75+
}
76+
],
77+
"headersSize": 533,
78+
"httpVersion": "HTTP/1.1",
79+
"method": "DELETE",
80+
"queryString": [],
81+
"url": "https://api.datadoghq.com/api/v1/logs/config/pipelines/BEg5CcvmSfyIGoMi9PWyTQ"
82+
},
83+
"response": {
84+
"bodySize": 3,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 3,
88+
"text": "{}\n"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 677,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2025-07-22T12:57:11.238Z",
104+
"time": 430
105+
}
106+
],
107+
"pages": [],
108+
"version": "1.2"
109+
}
110+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Create a pipeline with Decoder Processor returns "OK" response
3+
*/
4+
5+
import { client, v1 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v1.LogsPipelinesApi(configuration);
9+
10+
const params: v1.LogsPipelinesApiCreateLogsPipelineRequest = {
11+
body: {
12+
filter: {
13+
query: "source:python",
14+
},
15+
name: "testDecoderProcessor",
16+
processors: [
17+
{
18+
type: "decoder-processor",
19+
isEnabled: true,
20+
name: "test_decoder",
21+
source: "encoded.field",
22+
target: "decoded.field",
23+
binaryToTextEncoding: "base16",
24+
inputRepresentation: "utf_8",
25+
},
26+
],
27+
tags: [],
28+
},
29+
};
30+
31+
apiInstance
32+
.createLogsPipeline(params)
33+
.then((data: v1.LogsPipeline) => {
34+
console.log(
35+
"API called successfully. Returned data: " + JSON.stringify(data)
36+
);
37+
})
38+
.catch((error: any) => console.error(error));

features/v1/logs_pipelines.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ Feature: Logs Pipelines
7070
When the request is sent
7171
Then the response status is 200 OK
7272

73+
@team:DataDog/event-platform-experience
74+
Scenario: Create a pipeline with Decoder Processor returns "OK" response
75+
Given new "CreateLogsPipeline" request
76+
And body with value {"filter": {"query": "source:python"}, "name": "testDecoderProcessor", "processors": [{"type": "decoder-processor", "is_enabled": true, "name": "test_decoder", "source": "encoded.field", "target": "decoded.field", "binary_to_text_encoding": "base16", "input_representation": "utf_8"}], "tags": []}
77+
When the request is sent
78+
Then the response status is 200 OK
79+
7380
@team:DataDog/event-platform-experience
7481
Scenario: Create a pipeline with Span Id Remapper returns "OK" response
7582
Given new "CreateLogsPipeline" request

packages/datadog-api-client-v1/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,10 @@ export { LogsCategoryProcessorType } from "./models/LogsCategoryProcessorType";
571571
export { LogsDailyLimitReset } from "./models/LogsDailyLimitReset";
572572
export { LogsDateRemapper } from "./models/LogsDateRemapper";
573573
export { LogsDateRemapperType } from "./models/LogsDateRemapperType";
574+
export { LogsDecoderProcessor } from "./models/LogsDecoderProcessor";
575+
export { LogsDecoderProcessorBinaryToTextEncoding } from "./models/LogsDecoderProcessorBinaryToTextEncoding";
576+
export { LogsDecoderProcessorInputRepresentation } from "./models/LogsDecoderProcessorInputRepresentation";
577+
export { LogsDecoderProcessorType } from "./models/LogsDecoderProcessorType";
574578
export { LogsExclusion } from "./models/LogsExclusion";
575579
export { LogsExclusionFilter } from "./models/LogsExclusionFilter";
576580
export { LogsFilter } from "./models/LogsFilter";
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
import { LogsDecoderProcessorBinaryToTextEncoding } from "./LogsDecoderProcessorBinaryToTextEncoding";
7+
import { LogsDecoderProcessorInputRepresentation } from "./LogsDecoderProcessorInputRepresentation";
8+
import { LogsDecoderProcessorType } from "./LogsDecoderProcessorType";
9+
10+
import { AttributeTypeMap } from "../../datadog-api-client-common/util";
11+
12+
/**
13+
* The decoder processor decodes any source attribute containing a
14+
* base64/base16-encoded UTF-8/ASCII string back to its original value, storing the
15+
* result in a target attribute.
16+
*/
17+
export class LogsDecoderProcessor {
18+
/**
19+
* The encoding used to represent the binary data.
20+
*/
21+
"binaryToTextEncoding": LogsDecoderProcessorBinaryToTextEncoding;
22+
/**
23+
* The original representation of input string.
24+
*/
25+
"inputRepresentation": LogsDecoderProcessorInputRepresentation;
26+
/**
27+
* Whether the processor is enabled.
28+
*/
29+
"isEnabled"?: boolean;
30+
/**
31+
* Name of the processor.
32+
*/
33+
"name"?: string;
34+
/**
35+
* Name of the log attribute with the encoded data.
36+
*/
37+
"source": string;
38+
/**
39+
* Name of the log attribute that contains the decoded data.
40+
*/
41+
"target": string;
42+
/**
43+
* Type of logs decoder processor.
44+
*/
45+
"type": LogsDecoderProcessorType;
46+
47+
/**
48+
* A container for additional, undeclared properties.
49+
* This is a holder for any undeclared properties as specified with
50+
* the 'additionalProperties' keyword in the OAS document.
51+
*/
52+
"additionalProperties"?: { [key: string]: any };
53+
54+
/**
55+
* @ignore
56+
*/
57+
"_unparsed"?: boolean;
58+
59+
/**
60+
* @ignore
61+
*/
62+
static readonly attributeTypeMap: AttributeTypeMap = {
63+
binaryToTextEncoding: {
64+
baseName: "binary_to_text_encoding",
65+
type: "LogsDecoderProcessorBinaryToTextEncoding",
66+
required: true,
67+
},
68+
inputRepresentation: {
69+
baseName: "input_representation",
70+
type: "LogsDecoderProcessorInputRepresentation",
71+
required: true,
72+
},
73+
isEnabled: {
74+
baseName: "is_enabled",
75+
type: "boolean",
76+
},
77+
name: {
78+
baseName: "name",
79+
type: "string",
80+
},
81+
source: {
82+
baseName: "source",
83+
type: "string",
84+
required: true,
85+
},
86+
target: {
87+
baseName: "target",
88+
type: "string",
89+
required: true,
90+
},
91+
type: {
92+
baseName: "type",
93+
type: "LogsDecoderProcessorType",
94+
required: true,
95+
},
96+
additionalProperties: {
97+
baseName: "additionalProperties",
98+
type: "any",
99+
},
100+
};
101+
102+
/**
103+
* @ignore
104+
*/
105+
static getAttributeTypeMap(): AttributeTypeMap {
106+
return LogsDecoderProcessor.attributeTypeMap;
107+
}
108+
109+
public constructor() {}
110+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
7+
import { UnparsedObject } from "../../datadog-api-client-common/util";
8+
9+
/**
10+
* The encoding used to represent the binary data.
11+
*/
12+
13+
export type LogsDecoderProcessorBinaryToTextEncoding =
14+
| typeof BASE64
15+
| typeof BASE16
16+
| UnparsedObject;
17+
export const BASE64 = "base64";
18+
export const BASE16 = "base16";

0 commit comments

Comments
 (0)