Skip to content

[pkg/ottl] Support community ID network flow #34062

@mashhurs

Description

@mashhurs

Component(s)

pkg/ottl

Is your feature request related to a problem? Please describe.

What is a community ID and why do we need it?

  • It is a single unique ID based on the network flow info. It is an additional flow identifier and doesn't replace existing flow identification mechanisms already supported by the monitors. See the specification.
  • When monitoring/analyzing network flow, for example threat hunting security use cases, it's often required to make "joins" on network source and destination info where community_id simplifies, also gives a better user experience when analyzing the data (aggregate by community ID to collect statistics, etc.)
  • visual example

The feature is widely used and here some reference applications:

Describe the solution you'd like

Introduce a converter which calculates the community ID based on the specification.

Describe alternatives you've considered

This requires a discussion of either

Additional context

No response

Example

  • Config

processors:
  batch:
  transform:
    log_statements:
      - context: log
        statements:
          - set(attributes["community_id"], CommunityID(attributes["source.ip"], attributes["source.port"], attributes["destination.ip"], attributes["destination.port"]))
  • Expected output
Timestamp: 2018-12-13 14:51:00.3 +0000 UTC
SeverityText: Information
SeverityNumber: Info2(10)
Body: Str(Example log record)
Attributes:
     -> timestamp: Str(2025-05-21T09:25:18Z)
     -> source.ip: Str(123.124.125.126)
     -> source.port: Int(12345)
     -> destination.ip: Str(55.56.57.58)
     -> destination.port: Int(80)
     -> boolean.attribute: Bool(true)
     -> int.attribute: Int(10)
     -> double.attribute: Double(637.704)
     -> array.attribute: Slice(["many","values"])
     -> map.attribute: Map({"some.map.key":"some value"})
     -> community_id: Str(1:3vT0XsYnQuR8XHIYy6Acr7kpWGc=)
Trace ID: 5b8efff798038103d269b633813fc60c
Span ID: eee19b7ec3c1b174

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions