Skip to content

SrcNetPrefix / DstNetPrefix not working after upgrading to 1.8.0 #541

Description

@vincentbernat

Discussed in #540

Originally posted by ym March 2, 2023
The columns SrcNetPrefix and DstNetPrefix seemed to be removed from Clickhouse after upgrading to 1.8.0.

I got the following error while querying:

akvorado-console-1          | {"level":"error","error":"code: 47, message: Missing columns: 'SrcNetPrefix' while processing query: 'SELECT toStartOfInterval(TimeReceived + toIntervalSecond(9), toIntervalSecond(108)) - toIntervalSecond(9) AS time, (sum(Bytes * SamplingRate) * 8) / 108 AS xps, if((SrcAS, SrcNetPrefix) IN (rows AS _subquery445), [concat(toString(SrcAS), ': ', dictGetOrDefault('asns', 'name', SrcAS, '???')), SrcNetPrefix], ['Other', 'Other']) AS dimensions FROM source WHERE ((TimeReceived >= toDateTime('2023-03-02 12:41:15', 'UTC')) AND (TimeReceived <= toDateTime('2023-03-02 18:41:15', 'UTC'))) AND (InIfBoundary = 'external') GROUP BY time, dimensions ORDER BY time ASC WITH FILL FROM toDateTime('2023-03-02 12:41:15', 'UTC') TO toDateTime('2023-03-02 18:41:15', 'UTC') + toIntervalSecond(1) STEP 108 INTERPOLATE ( dimensions AS ['Other', 'Other'] )', required columns: 'TimeReceived' 'SrcAS' 'Bytes' 'SrcNetPrefix' 'InIfBoundary' 'SamplingRate' 'TimeReceived' 'SrcAS' 'Bytes' 'SrcNetPrefix' 'InIfBoundary' 'SamplingRate'","time":"2023-03-02T18:41:15Z","caller":"akvorado/console/line.go:253","module":"akvorado/console","message":"unable to query database"}

I tried to add it to enabled schema, but it's still not working. Any idea how to get it back?

Here is my akvorado.yaml:

---
kafka:
  topic: flows
  version: 3.3.1
  brokers:
    - kafka:9092
  topic-configuration:
    num-partitions: 8
    replication-factor: 1
    config-entries:
      # The retention policy in Kafka is mainly here to keep a buffer
      # for ClickHouse.
      segment.bytes: 1073741824
      retention.ms: 86400000 # 1 day
      cleanup.policy: delete
      compression.type: producer

clickhouse:
  orchestrator-url: http://akvorado-orchestrator:8080
  kafka:
    consumers: 4
  servers:
    - clickhouse:9000
  asns: {}
  networks: {}

inlet: !include "inlet.yaml"
console: !include "console.yaml"

schema:
  enabled:
    - SrcVlan
    - DstVlan
    - SrcMAC
    - DstMAC
    - SrcNetPrefix
    - DstNetPrefix

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