Skip to content

Add documentation for Logs Pipelines ReferenceTableLogsLookupProcessor #1240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2022-11-18 17:23:41.566917",
"spec_repo_commit": "b939bbb4"
"regenerated": "2022-11-18 18:21:26.952058",
"spec_repo_commit": "4aa21954"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2022-11-18 17:23:41.583133",
"spec_repo_commit": "b939bbb4"
"regenerated": "2022-11-18 18:21:26.967357",
"spec_repo_commit": "4aa21954"
}
}
}
54 changes: 51 additions & 3 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5012,7 +5012,9 @@ components:
associated target attribute values,

formatted as `["source_key1,target_value1", "source_key2,target_value2"]`'
example: []
example:
- source_key1,target_value1
- source_key2,target_value2
items:
description: Mapping between a source and a value, it should follow the
format `"<SOURCE>,<VALUE>"`.
Expand All @@ -5023,14 +5025,14 @@ components:
type: string
source:
description: Source attribute used to perform the lookup.
example: ''
example: service_id
type: string
target:
description: 'Name of the attribute that contains the corresponding value
in the mapping list

or the `default_lookup` if not found in the mapping list.'
example: ''
example: service
type: string
type:
$ref: '#/components/schemas/LogsLookupProcessorType'
Expand Down Expand Up @@ -5217,6 +5219,7 @@ components:
- $ref: '#/components/schemas/LogsPipelineProcessor'
- $ref: '#/components/schemas/LogsGeoIPParser'
- $ref: '#/components/schemas/LogsLookupProcessor'
- $ref: '#/components/schemas/ReferenceTableLogsLookupProcessor'
- $ref: '#/components/schemas/LogsTraceRemapper'
type: object
LogsQueryCompute:
Expand Down Expand Up @@ -8515,6 +8518,51 @@ components:
security_query:
$ref: '#/components/schemas/LogQueryDefinition'
type: object
ReferenceTableLogsLookupProcessor:
description: '**Note**: Reference Tables are in public beta.

Use the Lookup Processor to define a mapping between a log attribute

and a human readable value saved in a Reference Table.

For example, you can use the Lookup Processor to map an internal service ID

into a human readable service name. Alternatively, you could also use it to
check

if the MAC address that just attempted to connect to the production

environment belongs to your list of stolen machines.'
properties:
is_enabled:
default: false
description: Whether or not the processor is enabled.
type: boolean
lookup_enrichment_table:
description: Name of the Reference Table for the source attribute and their
associated target attribute values.
example: service_id_to_service_name_table
type: string
name:
description: Name of the processor.
type: string
source:
description: Source attribute used to perform the lookup.
example: service_id
type: string
target:
description: Name of the attribute that contains the corresponding value
in the mapping list.
example: service
type: string
type:
$ref: '#/components/schemas/LogsLookupProcessorType'
required:
- source
- target
- lookup_enrichment_table
- type
type: object
ResponseMetaAttributes:
description: Object describing meta attributes of response.
properties:
Expand Down
7 changes: 7 additions & 0 deletions docs/datadog_api_client.v1.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2535,6 +2535,13 @@ query\_value\_widget\_request
:members:
:show-inheritance:

reference\_table\_logs\_lookup\_processor
-----------------------------------------

.. automodule:: datadog_api_client.v1.model.reference_table_logs_lookup_processor
:members:
:show-inheritance:

response\_meta\_attributes
--------------------------

Expand Down
2 changes: 2 additions & 0 deletions src/datadog_api_client/v1/model/logs_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from datadog_api_client.v1.model.logs_pipeline_processor import LogsPipelineProcessor
from datadog_api_client.v1.model.logs_geo_ip_parser import LogsGeoIPParser
from datadog_api_client.v1.model.logs_lookup_processor import LogsLookupProcessor
from datadog_api_client.v1.model.reference_table_logs_lookup_processor import ReferenceTableLogsLookupProcessor
from datadog_api_client.v1.model.logs_trace_remapper import LogsTraceRemapper


Expand Down Expand Up @@ -89,6 +90,7 @@ def __init__(
LogsPipelineProcessor,
LogsGeoIPParser,
LogsLookupProcessor,
ReferenceTableLogsLookupProcessor,
LogsTraceRemapper,
]
],
Expand Down
2 changes: 2 additions & 0 deletions src/datadog_api_client/v1/model/logs_pipeline_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from datadog_api_client.v1.model.logs_string_builder_processor import LogsStringBuilderProcessor
from datadog_api_client.v1.model.logs_geo_ip_parser import LogsGeoIPParser
from datadog_api_client.v1.model.logs_lookup_processor import LogsLookupProcessor
from datadog_api_client.v1.model.reference_table_logs_lookup_processor import ReferenceTableLogsLookupProcessor
from datadog_api_client.v1.model.logs_trace_remapper import LogsTraceRemapper


Expand Down Expand Up @@ -80,6 +81,7 @@ def __init__(
LogsPipelineProcessor,
LogsGeoIPParser,
LogsLookupProcessor,
ReferenceTableLogsLookupProcessor,
LogsTraceRemapper,
]
],
Expand Down
5 changes: 5 additions & 0 deletions src/datadog_api_client/v1/model/logs_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ def __init__(self, **kwargs):
:param lookup_table: Mapping table of values for the source attribute and their associated target attribute values,
formatted as `["source_key1,target_value1", "source_key2,target_value2"]`
:type lookup_table: [str]

:param lookup_enrichment_table: Name of the Reference Table for the source attribute and their associated target attribute values.
:type lookup_enrichment_table: str
"""
super().__init__(kwargs)

Expand All @@ -114,6 +117,7 @@ def _composed_schemas(_):
from datadog_api_client.v1.model.logs_pipeline_processor import LogsPipelineProcessor
from datadog_api_client.v1.model.logs_geo_ip_parser import LogsGeoIPParser
from datadog_api_client.v1.model.logs_lookup_processor import LogsLookupProcessor
from datadog_api_client.v1.model.reference_table_logs_lookup_processor import ReferenceTableLogsLookupProcessor
from datadog_api_client.v1.model.logs_trace_remapper import LogsTraceRemapper

return {
Expand All @@ -132,6 +136,7 @@ def _composed_schemas(_):
LogsPipelineProcessor,
LogsGeoIPParser,
LogsLookupProcessor,
ReferenceTableLogsLookupProcessor,
LogsTraceRemapper,
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import TYPE_CHECKING, Union

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


if TYPE_CHECKING:
from datadog_api_client.v1.model.logs_lookup_processor_type import LogsLookupProcessorType


class ReferenceTableLogsLookupProcessor(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v1.model.logs_lookup_processor_type import LogsLookupProcessorType

return {
"is_enabled": (bool,),
"lookup_enrichment_table": (str,),
"name": (str,),
"source": (str,),
"target": (str,),
"type": (LogsLookupProcessorType,),
}

attribute_map = {
"is_enabled": "is_enabled",
"lookup_enrichment_table": "lookup_enrichment_table",
"name": "name",
"source": "source",
"target": "target",
"type": "type",
}

def __init__(
self_,
lookup_enrichment_table: str,
source: str,
target: str,
type: LogsLookupProcessorType,
is_enabled: Union[bool, UnsetType] = unset,
name: Union[str, UnsetType] = unset,
**kwargs,
):
"""
**Note** : Reference Tables are in public beta.
Use the Lookup Processor to define a mapping between a log attribute
and a human readable value saved in a Reference Table.
For example, you can use the Lookup Processor to map an internal service ID
into a human readable service name. Alternatively, you could also use it to check
if the MAC address that just attempted to connect to the production
environment belongs to your list of stolen machines.

:param is_enabled: Whether or not the processor is enabled.
:type is_enabled: bool, optional

:param lookup_enrichment_table: Name of the Reference Table for the source attribute and their associated target attribute values.
:type lookup_enrichment_table: str

:param name: Name of the processor.
:type name: str, optional

:param source: Source attribute used to perform the lookup.
:type source: str

:param target: Name of the attribute that contains the corresponding value in the mapping list.
:type target: str

:param type: Type of logs lookup processor.
:type type: LogsLookupProcessorType
"""
if is_enabled is not unset:
kwargs["is_enabled"] = is_enabled
if name is not unset:
kwargs["name"] = name
super().__init__(kwargs)

self_.lookup_enrichment_table = lookup_enrichment_table
self_.source = source
self_.target = target
self_.type = type
1 change: 1 addition & 0 deletions src/datadog_api_client/v1/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@
from datadog_api_client.v1.model.query_value_widget_definition import QueryValueWidgetDefinition
from datadog_api_client.v1.model.query_value_widget_definition_type import QueryValueWidgetDefinitionType
from datadog_api_client.v1.model.query_value_widget_request import QueryValueWidgetRequest
from datadog_api_client.v1.model.reference_table_logs_lookup_processor import ReferenceTableLogsLookupProcessor
from datadog_api_client.v1.model.response_meta_attributes import ResponseMetaAttributes
from datadog_api_client.v1.model.slo_bulk_delete import SLOBulkDelete
from datadog_api_client.v1.model.slo_bulk_delete_error import SLOBulkDeleteError
Expand Down