Split one string value into several fields

Hi!
Is there any way to split a field value like “-5.53dbm -4.95dbm -4.93dbm -4.46dbm” into different fields, using blank as spliter?

This is the current mesurement:
NGN-MIB::slot1ModuleIfTable,SNMPv2-MIB::sysName=xxxxxxxxx,source=1.1.1.1 NGN-MIB::slot1ModuleIfId=“f”,NGN-MIB::slot1ModuleifAdminStatus=“up(1)”,NGN-MIB::slot1ModuleifDescr=“1/f/57”,NGN-MIB::slot1ModuleifRxPower="-5.40dbm -4.68dbm -5.34dbm -5.17dbm ",NGN-MIB::slot1ModuleifType=“ethernetCsmacd(6)” 1737380530000000000

And this is what I need:
NGN-MIB::slot1ModuleIfTable,SNMPv2-MIB::sysName=xxxxxxxxx,source=1.1.1.1 NGN-MIB::slot1ModuleIfId=“f”,NGN-MIB::slot1ModuleifAdminStatus=“up(1)”,NGN-MIB::slot1ModuleifDescr=“1/f/57”,NGN-MIB::slot1ModuleifRxPower1=“-5.40dbm”,NGN-MIB::slot1ModuleifRxPower2=“-4.68dbm”,NGN-MIB::slot1ModuleifRxPower3=“-5.34dbm”,NGN-MIB::slot1ModuleifRxPower4=“-5.17dbm”,NGN-MIB::slot1ModuleifType=“ethernetCsmacd(6)” 1737380530000000000

I did not find split function in Strings Procesor plugin, is there any work around?

Thanks!

If it will always be a fixed amount of values in that string you could use processors.regex:

# Parse the RxPower field into multiple
[[processors.regex]]
  namepass = ["NGN-MIB::slot1ModuleIfTable"]

  [[processors.regex.fields]]
    key = "NGN-MIB::slot1ModuleifRxPower"
    pattern = '(\S+)dbm (\S+)dbm (\S+)dbm (\S+)dbm '
    replacement = "${1}"
    result_key = "slot1ModuleifRxPower1"

  [[processors.regex.fields]]
    key = "NGN-MIB::slot1ModuleifRxPower"
    pattern = '(\S+)dbm (\S+)dbm (\S+)dbm (\S+)dbm '
    replacement = "${2}"
    result_key = "slot1ModuleifRxPower2"

  [[processors.regex.fields]]
    key = "NGN-MIB::slot1ModuleifRxPower"
    pattern = '(\S+)dbm (\S+)dbm (\S+)dbm (\S+)dbm '
    replacement = "${3}"
    result_key = "slot1ModuleifRxPower3"

  [[processors.regex.fields]]
    key = "NGN-MIB::slot1ModuleifRxPower"
    pattern = '(\S+)dbm (\S+)dbm (\S+)dbm (\S+)dbm '
    replacement = "${4}"
    result_key = "slot1ModuleifRxPower4"

# Also convert them to float
[[processors.converter]]
  namepass = ["NGN-MIB::slot1ModuleIfTable"]

  [processors.converter.fields]
    float = ["slot1ModuleifRxPower*"]
1 Like

Great!
Yes, always would be the same number.
I will try it.
Thank you!