Ad Widget

Collapse

Zabbix log monitor - extract string at fixed position

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gbiondi
    Member
    • Nov 2016
    • 75

    #1

    Zabbix log monitor - extract string at fixed position

    Hi at all,


    I would like to extract some fields from a log record and create new items to record them.
    Imagine that such a string arrives:

    2019122215213800114001002

    I would extract the first 14 characters (ddMMyyyyhhmmss) and insert them in the localtime and then extract 001 from the position 15-17 and insert them in the value of the item.
    This would serve to check the status of a sensor (001) and hook it to the date and time of the event, simply to historically check at a given time how the sensor status was.

    In this string there is also the status of another sensor .. is it possible to build a new item with the same procedure and insert the value of the second sensor?
    In reality I get about 20 sensor states in a single string, but they are always in known positions.

    item.sensore.1
    20191222152138 value 001

    item.sensore.2
    20191222152138 value 002

    This is because in a string (or record) of the log I get more states of sensors ...

    Giorgio Biondi.
  • gbiondi
    Member
    • Nov 2016
    • 75

    #2
    Thanks..

    all the best..

    Comment

    Working...