snmp_exporter icon indicating copy to clipboard operation
snmp_exporter copied to clipboard

Allow scaling value after regex extract

Open llamafilm opened this issue 9 months ago • 1 comments

After using regex_extract to turn a string into a number, sometimes that number needs to be scaled. For example, I have a metric like this:

cp850FaderLevel{cp850FaderLevel="0x3730"} 1

I use this config:

    overrides:
      cp850FaderLevel:
        type: DisplayString
        regex_extracts:
          '':
          - regex: '(.*)'
            value: '$1'
        scale: 0.1

The scale is ignored, so the result is this:

cp850FaderLevel 70

I use version 0.28.0.

llamafilm avatar Apr 15 '25 01:04 llamafilm

That sounds like a bug in the ordering of the data processing. Should be fixable.

SuperQ avatar Apr 15 '25 09:04 SuperQ