Skip to content

Commit 97a5504

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

7 files changed

Lines changed: 162 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.

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

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

packages/datadog-api-client-v1/models/LogsProcessor.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { LogsAttributeRemapper } from "./LogsAttributeRemapper";
99
import { LogsCategoryProcessor } from "./LogsCategoryProcessor";
1010
import { LogsDateRemapper } from "./LogsDateRemapper";
1111
import { LogsDecoderProcessor } from "./LogsDecoderProcessor";
12+
import { LogsExcludeAttributeProcessor } from "./LogsExcludeAttributeProcessor";
1213
import { LogsGeoIPParser } from "./LogsGeoIPParser";
1314
import { LogsGrokParser } from "./LogsGrokParser";
1415
import { LogsLookupProcessor } from "./LogsLookupProcessor";
@@ -51,4 +52,5 @@ export type LogsProcessor =
5152
| LogsArrayProcessor
5253
| LogsDecoderProcessor
5354
| LogsSchemaProcessor
55+
| LogsExcludeAttributeProcessor
5456
| UnparsedObject;

packages/datadog-api-client-v1/models/ObjectSerializer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ import { LogsCategoryProcessorCategory } from "./LogsCategoryProcessorCategory";
187187
import { LogsDailyLimitReset } from "./LogsDailyLimitReset";
188188
import { LogsDateRemapper } from "./LogsDateRemapper";
189189
import { LogsDecoderProcessor } from "./LogsDecoderProcessor";
190+
import { LogsExcludeAttributeProcessor } from "./LogsExcludeAttributeProcessor";
190191
import { LogsExclusion } from "./LogsExclusion";
191192
import { LogsExclusionFilter } from "./LogsExclusionFilter";
192193
import { LogsFilter } from "./LogsFilter";
@@ -1114,6 +1115,7 @@ const enumsMap: { [key: string]: any[] } = {
11141115
LogsDecoderProcessorBinaryToTextEncoding: ["base64", "base16"],
11151116
LogsDecoderProcessorInputRepresentation: ["utf_8", "integer"],
11161117
LogsDecoderProcessorType: ["decoder-processor"],
1118+
LogsExcludeAttributeProcessorType: ["exclude-attribute"],
11171119
LogsGeoIPParserType: ["geo-ip-parser"],
11181120
LogsGrokParserType: ["grok-parser"],
11191121
LogsLookupProcessorType: ["lookup-processor"],
@@ -2185,6 +2187,7 @@ const typeMap: { [index: string]: any } = {
21852187
LogsDailyLimitReset: LogsDailyLimitReset,
21862188
LogsDateRemapper: LogsDateRemapper,
21872189
LogsDecoderProcessor: LogsDecoderProcessor,
2190+
LogsExcludeAttributeProcessor: LogsExcludeAttributeProcessor,
21882191
LogsExclusion: LogsExclusion,
21892192
LogsExclusionFilter: LogsExclusionFilter,
21902193
LogsFilter: LogsFilter,
@@ -2840,6 +2843,7 @@ const oneOfMap: { [index: string]: string[] } = {
28402843
"LogsArrayProcessor",
28412844
"LogsDecoderProcessor",
28422845
"LogsSchemaProcessor",
2846+
"LogsExcludeAttributeProcessor",
28432847
],
28442848
LogsSchemaMapper: ["LogsSchemaRemapper", "LogsSchemaCategoryMapper"],
28452849
MonitorFormulaAndFunctionAggregateAugmentQuery: [

0 commit comments

Comments
 (0)