go.web_log aggregates the metrics ? How can I monitor a web_log by Web site?

Problem/Question

I want to monitor the web_log by website.

In the local dashboard, I can’t see the web_log counter by log file.
I see only one node called Web Server Logs

Relevant docs you followed/actions you took to solve the issue

I have changed the web_log.conf file
after following this page

The content is:

jobs:
  - name: nginx
    path: /var/log/nginx/access.log
  - name: datacadamia
    path: /var/log/nginx//datacadamia.com/https-access.log

I can see that the log file are read thanks to a debug output:

[ DEBUG ] web_log[nginx] init.go:105 starting log reader creating
[ DEBUG ] web_log[nginx] reader.go:73 open log file: /var/log/nginx/access.log
[ DEBUG ] web_log[nginx] init.go:110 created log reader, current file '/var/log/nginx/access.log'
[ DEBUG ] web_log[nginx] init.go:116 starting parser creating
..............
[ DEBUG ] web_log[datacadamia] reader.go:73 open log file: /var/log/nginx/datacadamia.com/https-access.log
[ DEBUG ] web_log[datacadamia] init.go:110 created log reader, current file '/var/log/nginx/datacadamia.com/https-access.log'
[ DEBUG ] web_log[datacadamia] init.go:116 starting parser creating

Environment/Browser/Agent’s version etc

bash-4.2$ netdata -v
netdata v1.42.3

What I expected to happen

I would expect to see 2 nodes in the outline of the local dashboard:

  • one for nginx
  • one for the website: datacadamia

Configuration is not complete

In the file, they send me to this file for all possible configuration
https://github.com/netdata/go.d.plugin/tree/master/modules/web_log
but it does not exist.
So I don’t know if it can be solved by a configuration.

You should see a single ‘node’ named “Web Server Logs”.
Each chart under that is a consolidated view of all the data the netdata agent has for that metric.
Check it out in the Netdata demo environment:

Does that match up with what you see?
Note that many charts are composites where you can use the filters to drill down to see specific hosts or instances of a collector.
For example, you may want to select the Group by Instance drop down above one of the weblog charts and chose only the checkbox for “web server (instance)”

N.B. That URL looks to have gotten renamed to remove the underscore:

1 Like

Yes it matches with what I see.

I just discover that you can choose by graph the log file (called web server).

I was hoping to be able to filter all chart at once by website app.

Thanks.

Hi @gerardnico

I take you to mean that, in your example, the following are actually two logs for the same web-application?

jobs:
  - name: nginx
    path: /var/log/nginx/access.log
  - name: datacadamia
    path: /var/log/nginx/datacadamia.com/https-access.log

If this is so…

First off, the very simplest thing would be to simply use two filters:

Group by -> Dimension
Labels -> _collect_job <select both of your jobs: nginx, datacadamia>

As an aside, I had a play and you can actually specify a web_log job multiple times with the same name but different path_values. However, IMO the filtering above gives a better result: that’s because the suggested filtering allows you to select and de-select jobs using the labels filter, while still being able to group by something else- for example if your web app is distributed on many servers then it would allow you to group be node etc and then by job.