I am trying to write a discovery rule for finding XFS project quotas using the `/etc/projects` file.
The file is very simple like this:
What I need is to get the paths and fetch them using LLD macros, or that is my plan....
I thought I could use
vfs.file.contents[/etc/projects]
then a regex to match
then turn it into JSON... but the regex only seem to match the 1st line and stop. I could not manage to give it the global modifier.
I would like to avoid running shell scripts to manipulate the text into JSON but it may be the only way perhaps. Is there any better way?
Thanks!
The file is very simple like this:
Code:
20:/tmp 30:/home 40:/var/crash 50:/var/tmp 60:/var/log 70:/var/lib/postgresql/
I thought I could use
vfs.file.contents[/etc/projects]
then a regex to match
Code:
\d+:(.*)
I would like to avoid running shell scripts to manipulate the text into JSON but it may be the only way perhaps. Is there any better way?
Thanks!