Is there a way in Netdata to monitor local application logs and raise alerts when a specific regular expression matches? I want to monitor any log file not just web server logs.
Can someone please help? We are exploring Netdata to see if it can meet our requirements.
Hey, sorry for that.
At this moment, we don’t offer a generalized log collector, only for nginx/apache.
We are working on it though, so it shouldn’t be too far!
@ilyam8 perhaps the user could hack the existing collector for their own needs?
Looks like maybe you could explore framing it as a custom log format and then using custom patterns.
I see this in the docs: Web server log (Apache, NGINX) monitoring with Netdata | Learn Netdata
Looks like maybe could be worth looking at or exploring a bit.
Unfortunately, we have no collector that does what you want. I agree that we need to add something like that. I will add this to my TODO list (i need to think about it).
But you can give a try to netdata/collectors/python.d.plugin/logparser at logparser · hamedbrd/netdata · GitHub
It won’t be merged into the master (we will write the collector in golang), but it should work for simple cases.
so @ilyam8 would a user just need to do something like this to ‘get’ that collector:
# get the collector code sudo wget "https://raw.githubusercontent.com/hamedbrd/netdata/logparser/collectors/python.d.plugin/logparser/logparser.chart.py" -P /usr/libexec/netdata/python.d/ # get the collector conf file (which you can then edit manually) sudo wget "https://raw.githubusercontent.com/hamedbrd/netdata/logparser/collectors/python.d.plugin/logparser/logparser.conf" -P /etc/netdata/python.d/
I was going to make an update to the docs here (Supported collectors list | Learn Netdata) to show an example of how a user can ‘install’ a third party collector into their netdata without having to run a fork or anything like that.
Is my approach above ok or is there a better way?
I think it could be nice if we made it super easy for users to just pull in third party collectors very easily. @Austin_Hemmelgarn i wonder what your thoughts are too on this?
pr with my proposed update to the docs: add example of how to install a third party collector by andrewm4894 · Pull Request #11308 · netdata/netdata · GitHub
Thanks. I saw #7420, which caters to generic Go logparser requirement but it’s in open state since 2019 and discussion thread is not active. If #7420 can’t be prioritized, can you pls think about merging python plugin so that community can get this feature. Is there any specific reason you don’t want to merge the python version? is there a plan to use Go as the preferred language for all future plugins?
Thanks @andrewm4894 . I will check.