Skip to content

Commit 582abbe

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add decoder processor to public api (#2512)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 6e4d3ae commit 582abbe

File tree

12 files changed

+333
-2
lines changed

12 files changed

+333
-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": "a784d79",
3-
"generated": "2025-07-23 14:43:28.553"
2+
"spec_repo_commit": "4727afe",
3+
"generated": "2025-07-23 15:36:46.681"
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+
}

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

services/logs_pipelines/src/v1/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export { LogsCategoryProcessorCategory } from "./models/LogsCategoryProcessorCat
2828
export { LogsCategoryProcessorType } from "./models/LogsCategoryProcessorType";
2929
export { LogsDateRemapper } from "./models/LogsDateRemapper";
3030
export { LogsDateRemapperType } from "./models/LogsDateRemapperType";
31+
export { LogsDecoderProcessor } from "./models/LogsDecoderProcessor";
32+
export { LogsDecoderProcessorBinaryToTextEncoding } from "./models/LogsDecoderProcessorBinaryToTextEncoding";
33+
export { LogsDecoderProcessorInputRepresentation } from "./models/LogsDecoderProcessorInputRepresentation";
34+
export { LogsDecoderProcessorType } from "./models/LogsDecoderProcessorType";
3135
export { LogsFilter } from "./models/LogsFilter";
3236
export { LogsGeoIPParser } from "./models/LogsGeoIPParser";
3337
export { LogsGeoIPParserType } from "./models/LogsGeoIPParserType";
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
import { AttributeTypeMap } from "@datadog/datadog-api-client";
2+
3+
import { LogsDecoderProcessorBinaryToTextEncoding } from "./LogsDecoderProcessorBinaryToTextEncoding";
4+
import { LogsDecoderProcessorInputRepresentation } from "./LogsDecoderProcessorInputRepresentation";
5+
import { LogsDecoderProcessorType } from "./LogsDecoderProcessorType";
6+
7+
/**
8+
* The decoder processor decodes any source attribute containing a
9+
* base64/base16-encoded UTF-8/ASCII string back to its original value, storing the
10+
* result in a target attribute.
11+
*/
12+
export class LogsDecoderProcessor {
13+
/**
14+
* The encoding used to represent the binary data.
15+
*/
16+
"binaryToTextEncoding": LogsDecoderProcessorBinaryToTextEncoding;
17+
/**
18+
* The original representation of input string.
19+
*/
20+
"inputRepresentation": LogsDecoderProcessorInputRepresentation;
21+
/**
22+
* Whether the processor is enabled.
23+
*/
24+
"isEnabled"?: boolean;
25+
/**
26+
* Name of the processor.
27+
*/
28+
"name"?: string;
29+
/**
30+
* Name of the log attribute with the encoded data.
31+
*/
32+
"source": string;
33+
/**
34+
* Name of the log attribute that contains the decoded data.
35+
*/
36+
"target": string;
37+
/**
38+
* Type of logs decoder processor.
39+
*/
40+
"type": LogsDecoderProcessorType;
41+
/**
42+
* A container for additional, undeclared properties.
43+
* This is a holder for any undeclared properties as specified with
44+
* the 'additionalProperties' keyword in the OAS document.
45+
*/
46+
"additionalProperties"?: { [key: string]: any };
47+
/**
48+
* @ignore
49+
*/
50+
"_unparsed"?: boolean;
51+
52+
/**
53+
* @ignore
54+
*/
55+
static readonly attributeTypeMap: AttributeTypeMap = {
56+
binaryToTextEncoding: {
57+
baseName: "binary_to_text_encoding",
58+
type: "LogsDecoderProcessorBinaryToTextEncoding",
59+
required: true,
60+
},
61+
inputRepresentation: {
62+
baseName: "input_representation",
63+
type: "LogsDecoderProcessorInputRepresentation",
64+
required: true,
65+
},
66+
isEnabled: {
67+
baseName: "is_enabled",
68+
type: "boolean",
69+
},
70+
name: {
71+
baseName: "name",
72+
type: "string",
73+
},
74+
source: {
75+
baseName: "source",
76+
type: "string",
77+
required: true,
78+
},
79+
target: {
80+
baseName: "target",
81+
type: "string",
82+
required: true,
83+
},
84+
type: {
85+
baseName: "type",
86+
type: "LogsDecoderProcessorType",
87+
required: true,
88+
},
89+
additionalProperties: {
90+
baseName: "additionalProperties",
91+
type: "{ [key: string]: any; }",
92+
},
93+
};
94+
95+
/**
96+
* @ignore
97+
*/
98+
static getAttributeTypeMap(): AttributeTypeMap {
99+
return LogsDecoderProcessor.attributeTypeMap;
100+
}
101+
102+
public constructor() {}
103+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { UnparsedObject } from "@datadog/datadog-api-client";
2+
3+
/**
4+
* The encoding used to represent the binary data.
5+
*/
6+
export type LogsDecoderProcessorBinaryToTextEncoding =
7+
| typeof BASE64
8+
| typeof BASE16
9+
| UnparsedObject;
10+
export const BASE64 = "base64";
11+
export const BASE16 = "base16";
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { UnparsedObject } from "@datadog/datadog-api-client";
2+
3+
/**
4+
* The original representation of input string.
5+
*/
6+
export type LogsDecoderProcessorInputRepresentation =
7+
| typeof UTF_8
8+
| typeof INTEGER
9+
| UnparsedObject;
10+
export const UTF_8 = "utf_8";
11+
export const INTEGER = "integer";
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { UnparsedObject } from "@datadog/datadog-api-client";
2+
3+
/**
4+
* Type of logs decoder processor.
5+
*/
6+
export type LogsDecoderProcessorType =
7+
| typeof DECODER_PROCESSOR
8+
| UnparsedObject;
9+
export const DECODER_PROCESSOR = "decoder-processor";

0 commit comments

Comments
 (0)