Ad Widget

Collapse

preprocessing regex issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tomclay
    Junior Member
    • Jan 2019
    • 8

    #1

    preprocessing regex issue

    I am pulling the contents of a file using vfs.file.contents and I am trying to use regex to filter speciffic lines. I have found that zabbix does not support the /g flag so its only returing the first line.

    Here is an example of what I am trying to acheive (with the g flag) https://regex101.com/r/M8UQvP/1

    I have looked at using log, but once the history is cleared it will not pull old data so this will not work for me. As the file will not be changed too often, my plan is to set the update interval to 1 day and the history to 1 day, so I only get the latest data.

    Is there any way I can do this either with vfs.file.contents, or something else. Idealy it would not require a change on all agents as I have quite a lot.



    Thanks
  • tomclay
    Junior Member
    • Jan 2019
    • 8

    #2
    I actually have another example of where this would be useful, I would like to maintain a list of users with access to servers by extracting the E-mail address at the end of the ssh key in the authorized_keys file, but again as I cant add /g, it only gets the first user.

    Comment

    • tomclay
      Junior Member
      • Jan 2019
      • 8

      #3
      I hate to bump threads, but is anyone able to help? I am still stuck on this and really need this to work.

      Comment

      Working...