Ad Widget

Collapse

how to split string that contains more than one value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • l.grube
    Junior Member
    • Oct 2023
    • 3

    #1

    how to split string that contains more than one value

    Hi

    I have a value from my LENOVO switch
    Sensor 1: 41.0 C; Sensor 2: 25.5 C; Sensor 3: 34.25 C; Sensor 4: 43.75 C; Sensor 5: 33.25 C;

    how to split this string from zabbix ?

    thanks for your help.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Split ? like each sensor to each own item?
    preprocessing ("right trim", remove last ; then "csv to json")
    Code:
    [
      {
        "1": "Sensor 1: 41.0 C",
        "2": "Sensor 2: 25.5 C",
        "3": "Sensor 3: 34.25 C",
        "4": "Sensor 4: 43.75 C",
        "5": "Sensor 5: 33.25 C"
      }
    ]
    ​
    +a bit of discovery (dependent), so you would get just right amount of items with item prototype (dependent item.. some jsonpath and regex preprocessing to extract just numbers).
    Last edited by cyber; 25-10-2023, 16:24.

    Comment

    Working...