gnmic
gnmic copied to clipboard
How to use encoding: bytes with convert-int-processor ?
trafficstars
Hi,
I have configuration to collect statistics, now I wanted to add "port_stats" but seems it doesn't work, I don't see anything in Influx. Seems convert-int-processor has broken output. How to fix it?
subscriptions:
bearer_traffic_stats:
paths:
- "/state/mobile-gateway/pdn[gw-id=1]/statistics/gtp-u/bearer-traffic/resource[group-id=*]/dropped-downlink-packets-session-not-found"
- "/state/mobile-gateway/pdn[gw-id=1]/statistics/gtp-u/bearer-traffic/resource[group-id=*]/per-access-type"
- "/state/mobile-gateway/pdn[gw-id=1]/statistics/gtp-u/bearer-traffic/resource[group-id=*]/per-reference-point"
- "/state/mobile-gateway/pdn[gw-id=1]/statistics/gtp-u/management"
stream-mode: sample
sample-interval: 1m
encoding: JSON
cpu:
paths:
- "/state/vm[vm-id=*]/control-plane"
- "/state/vm[vm-id=*]/forwarding-plane"
stream-mode: sample
sample-interval: 1m
encoding: JSON
session_management:
paths:
- "/state/mobile-gateway/pdn[gw-id=1]/statistics/session-management/performance"
- "/state/mobile-gateway/pdn[gw-id=1]/statistics/session-management/capacity"
stream-mode: sample
sample-interval: 1m
encoding: JSON
port_stats:
paths:
- "/state/port[port-id=1/1/9]/statistics/in-octets"
- "/state/port[port-id=1/1/9]/statistics/out-octets"
stream-mode: sample
sample-interval: 1m
encoding: bytes
processors:
convert-int-processor:
event-convert:
value-names:
- ".*packets.*$"
- ".*bytes.*$"
type: int
sample-processor:
event-strings:
value-names:
- ".*"
transforms:
- path-base:
apply-on: "name"
Can you provide a sample output of how port_stats responses look like in the cli without processors ?
"source": "10.103.146.124:57400",
"timestamp": 1744782119489797450,
"time": "2025-04-16T08:41:59.48979745+03:00",
"updates": [
{
"Path": "state/port[port-id=1/1/9]/statistics/in-octets",
"values": {
"state/port/statistics/in-octets": "1938459431"
"source": "10.103.146.124:57400",
"timestamp": 1744782208969069530,
"time": "2025-04-16T08:43:28.96906953+03:00",
"updates": [
{
"Path": "state/port[port-id=1/1/9]/statistics/out-octets",
"values": {
"state/port/statistics/out-octets": "1478741738"
@karimra any comments on this?
Any comments on this?
Your value is named octets and the processor only looks at bytes and packets?