Skip to content

Commit e20c1c3

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add exclude-attribute processor to logs pipelines (#4120)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 7ec889e commit e20c1c3

7 files changed

Lines changed: 148 additions & 24 deletions

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6215,6 +6215,38 @@ components:
62156215
type: string
62166216
x-enum-varnames:
62176217
- DECODER_PROCESSOR
6218+
LogsExcludeAttributeProcessor:
6219+
description: |-
6220+
Use this processor to remove an attribute from a log during processing.
6221+
The processor strips the specified attribute from the log event, which is useful
6222+
when the attribute contains sensitive data or is no longer needed downstream.
6223+
properties:
6224+
attribute_to_exclude:
6225+
description: Name of the log attribute to remove from the log event.
6226+
example: foo
6227+
type: string
6228+
is_enabled:
6229+
default: false
6230+
description: Whether or not the processor is enabled.
6231+
type: boolean
6232+
name:
6233+
description: Name of the processor.
6234+
type: string
6235+
type:
6236+
$ref: "#/components/schemas/LogsExcludeAttributeProcessorType"
6237+
required:
6238+
- type
6239+
- attribute_to_exclude
6240+
type: object
6241+
LogsExcludeAttributeProcessorType:
6242+
default: exclude-attribute
6243+
description: Type of logs exclude attribute processor.
6244+
enum:
6245+
- exclude-attribute
6246+
example: exclude-attribute
6247+
type: string
6248+
x-enum-varnames:
6249+
- EXCLUDE_ATTRIBUTE
62186250
LogsExclusion:
62196251
description: Represents the index exclusion filter object from configuration API.
62206252
properties:
@@ -6822,6 +6854,7 @@ components:
68226854
- $ref: "#/components/schemas/LogsArrayProcessor"
68236855
- $ref: "#/components/schemas/LogsDecoderProcessor"
68246856
- $ref: "#/components/schemas/LogsSchemaProcessor"
6857+
- $ref: "#/components/schemas/LogsExcludeAttributeProcessor"
68256858
LogsQueryCompute:
68266859
description: Define computation for a log query.
68276860
properties:

features/v1/logs_pipelines.feature

Lines changed: 24 additions & 24 deletions
Large diffs are not rendered by default.

services/logs_pipelines/src/v1/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export { LogsDecoderProcessor } from "./models/LogsDecoderProcessor";
3232
export { LogsDecoderProcessorBinaryToTextEncoding } from "./models/LogsDecoderProcessorBinaryToTextEncoding";
3333
export { LogsDecoderProcessorInputRepresentation } from "./models/LogsDecoderProcessorInputRepresentation";
3434
export { LogsDecoderProcessorType } from "./models/LogsDecoderProcessorType";
35+
export { LogsExcludeAttributeProcessor } from "./models/LogsExcludeAttributeProcessor";
36+
export { LogsExcludeAttributeProcessorType } from "./models/LogsExcludeAttributeProcessorType";
3537
export { LogsFilter } from "./models/LogsFilter";
3638
export { LogsGeoIPParser } from "./models/LogsGeoIPParser";
3739
export { LogsGeoIPParserType } from "./models/LogsGeoIPParserType";
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import { AttributeTypeMap } from "@datadog/datadog-api-client";
2+
3+
import { LogsExcludeAttributeProcessorType } from "./LogsExcludeAttributeProcessorType";
4+
5+
/**
6+
* Use this processor to remove an attribute from a log during processing.
7+
* The processor strips the specified attribute from the log event, which is useful
8+
* when the attribute contains sensitive data or is no longer needed downstream.
9+
*/
10+
export class LogsExcludeAttributeProcessor {
11+
/**
12+
* Name of the log attribute to remove from the log event.
13+
*/
14+
"attributeToExclude": string;
15+
/**
16+
* Whether or not the processor is enabled.
17+
*/
18+
"isEnabled"?: boolean;
19+
/**
20+
* Name of the processor.
21+
*/
22+
"name"?: string;
23+
/**
24+
* Type of logs exclude attribute processor.
25+
*/
26+
"type": LogsExcludeAttributeProcessorType;
27+
/**
28+
* A container for additional, undeclared properties.
29+
* This is a holder for any undeclared properties as specified with
30+
* the 'additionalProperties' keyword in the OAS document.
31+
*/
32+
"additionalProperties"?: { [key: string]: any };
33+
/**
34+
* @ignore
35+
*/
36+
"_unparsed"?: boolean;
37+
38+
/**
39+
* @ignore
40+
*/
41+
static readonly attributeTypeMap: AttributeTypeMap = {
42+
attributeToExclude: {
43+
baseName: "attribute_to_exclude",
44+
type: "string",
45+
required: true,
46+
},
47+
isEnabled: {
48+
baseName: "is_enabled",
49+
type: "boolean",
50+
},
51+
name: {
52+
baseName: "name",
53+
type: "string",
54+
},
55+
type: {
56+
baseName: "type",
57+
type: "LogsExcludeAttributeProcessorType",
58+
required: true,
59+
},
60+
additionalProperties: {
61+
baseName: "additionalProperties",
62+
type: "{ [key: string]: any; }",
63+
},
64+
};
65+
66+
/**
67+
* @ignore
68+
*/
69+
static getAttributeTypeMap(): AttributeTypeMap {
70+
return LogsExcludeAttributeProcessor.attributeTypeMap;
71+
}
72+
73+
public constructor() {}
74+
}
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 exclude attribute processor.
5+
*/
6+
export type LogsExcludeAttributeProcessorType =
7+
| typeof EXCLUDE_ATTRIBUTE
8+
| UnparsedObject;
9+
export const EXCLUDE_ATTRIBUTE = "exclude-attribute";

services/logs_pipelines/src/v1/models/LogsProcessor.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { LogsAttributeRemapper } from "./LogsAttributeRemapper";
66
import { LogsCategoryProcessor } from "./LogsCategoryProcessor";
77
import { LogsDateRemapper } from "./LogsDateRemapper";
88
import { LogsDecoderProcessor } from "./LogsDecoderProcessor";
9+
import { LogsExcludeAttributeProcessor } from "./LogsExcludeAttributeProcessor";
910
import { LogsGeoIPParser } from "./LogsGeoIPParser";
1011
import { LogsGrokParser } from "./LogsGrokParser";
1112
import { LogsLookupProcessor } from "./LogsLookupProcessor";
@@ -45,4 +46,5 @@ export type LogsProcessor =
4546
| LogsArrayProcessor
4647
| LogsDecoderProcessor
4748
| LogsSchemaProcessor
49+
| LogsExcludeAttributeProcessor
4850
| UnparsedObject;

services/logs_pipelines/src/v1/models/TypingInfo.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { LogsCategoryProcessor } from "./LogsCategoryProcessor";
1313
import { LogsCategoryProcessorCategory } from "./LogsCategoryProcessorCategory";
1414
import { LogsDateRemapper } from "./LogsDateRemapper";
1515
import { LogsDecoderProcessor } from "./LogsDecoderProcessor";
16+
import { LogsExcludeAttributeProcessor } from "./LogsExcludeAttributeProcessor";
1617
import { LogsFilter } from "./LogsFilter";
1718
import { LogsGeoIPParser } from "./LogsGeoIPParser";
1819
import { LogsGrokParser } from "./LogsGrokParser";
@@ -51,6 +52,7 @@ export const TypingInfo: ModelTypingInfo = {
5152
LogsDecoderProcessorBinaryToTextEncoding: ["base64", "base16"],
5253
LogsDecoderProcessorInputRepresentation: ["utf_8", "integer"],
5354
LogsDecoderProcessorType: ["decoder-processor"],
55+
LogsExcludeAttributeProcessorType: ["exclude-attribute"],
5456
LogsGeoIPParserType: ["geo-ip-parser"],
5557
LogsGrokParserType: ["grok-parser"],
5658
LogsLookupProcessorType: ["lookup-processor"],
@@ -95,6 +97,7 @@ export const TypingInfo: ModelTypingInfo = {
9597
"LogsArrayProcessor",
9698
"LogsDecoderProcessor",
9799
"LogsSchemaProcessor",
100+
"LogsExcludeAttributeProcessor",
98101
],
99102
LogsSchemaMapper: ["LogsSchemaRemapper", "LogsSchemaCategoryMapper"],
100103
},
@@ -112,6 +115,7 @@ export const TypingInfo: ModelTypingInfo = {
112115
LogsCategoryProcessorCategory: LogsCategoryProcessorCategory,
113116
LogsDateRemapper: LogsDateRemapper,
114117
LogsDecoderProcessor: LogsDecoderProcessor,
118+
LogsExcludeAttributeProcessor: LogsExcludeAttributeProcessor,
115119
LogsFilter: LogsFilter,
116120
LogsGeoIPParser: LogsGeoIPParser,
117121
LogsGrokParser: LogsGrokParser,

0 commit comments

Comments
 (0)