Skip to content

Can't use regex_replace operator #676

@jamespavett

Description

@jamespavett

Having a slight issue using stanza operators on the filelog receiver. Essentially I was to strip out some data from log messages prior to them being processed.

SigNoz Otel Collector version: v0.129.2
SigNoz k8s-infra helm chart version: v0.14.1

Helm chart config:

    operators:
      - id: container-parser
        type: container
      - id: regex_replace
        type: regex_replace
        field: body
        regex: '^\[[0-9T:\.\+\-]+?\]\s*'
        if: 'attributes["k8s.namespace.name"] == "default"'

Comes out as this in the config map:

  receivers:
     filelog/k8s:
       exclude:
       - /var/log/pods/monitoring_signoz-k8s-infra*-signoz-*/*/*.log
       - /var/log/pods/monitoring_signoz-k8s-infra*-k8s-infra-*/*/*.log
       - /var/log/pods/kube-system_*/*/*.log
       - /var/log/pods/*_hotrod*_*/*/*.log
       - /var/log/pods/*_locust*_*/*/*.log
       include:
       - /var/log/pods/*/*/*.log
       include_file_name: false
       include_file_path: true
       operators:
       - id: container-parser
         type: container
       - field: body
         id: regex_replace
         if: attributes["k8s.namespace.name"] == "idefault"
         regex: ^\[[0-9T:\.\+\-]+?\]\s*
         type: regex_replace
2025/09/05 15:43:07 collector server run finished with error: failed to get config: cannot unmarshal the configuration: decoding failed due to the following error(s):
error decoding 'receivers': error reading configuration for "filelog/k8s": decoding failed due to the following error(s):
error decoding 'operators[1]': unsupported type 'regex_replace'

It is suggesting that this type doesn't existing, however the collector us currently using /pkg/stanza v0.128.0, and this was released back in v122.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions