Issue switch from python.d to go.d web_log plugin

Hello,

My Netdata version is v1.44.1 running on Ubuntu 22.04

I want to switch from python.d to go.d web_log plugin but I’m not able to find a way to reproduce my current python.d config which is the following

apache_log2:
  name: redacted
  path: "/home/redacted/log/apache2/access.log"
  filter:
    exclude: status.html
apache_log_lb:
  name: Log_lb
  path: "/home/redacted/log/apache2/access.log"
  filter:
    include: status.html

The idea of this config is to have 2 graph, one for the users requests, and another for the LB requests, which are checking the status of the serveur using status.html URL.

I tried multiple config without luck, and the documentation does not give a full example of the url_patterns syntax.

For example:

---
jobs:
  - name: redacted
    path: /home/redacted/log/apache2/access.log
    url_patterns:
      - name: user_log
        pattern: !status.html
  - name: Log_lb
    path: /home/redacted/log/apache2/access.log
    url_patterns:
      - name: lb_log
        pattern: status.html

Give me the following error:

DBG jobmgr/manager.go:127 received config group ('/etc/netdata/go.d/web_log.conf'): 2 jobs (added: 2, removed: 0) component="job manager"
DYNCFG_REGISTER_JOB 'web_log' 'redacted_13500880902113835806' 'stock' 0

DBG jobmgr/manager.go:265 creating web_log[redacted] job, config: map[__provider__:file reader __source__:/etc/netdata/go.d/web_log.conf autodetection_retry:0 module:web_log name:redacted path:/home/redacted/log/apache2/access.log priority:70000 update_every:1 url_patterns:[map[name:user_log pattern:]]] component="job manager"
DBG weblog/init.go:36 starting URL patterns creating collector=web_log job=redacted
ERR weblog/weblog.go:97 init failed: create pattern {Name:user_log Match:}: empty 'name' or 'match' collector=web_log job=redacted
ERR module/job.go:222 init failed collector=web_log job=redacted
REPORT_JOB_STATUS 'web_log' 'redacted_13500880902113835806' 'error' 0 'job detection failed, stopping it'

DYNCFG_REGISTER_JOB 'web_log' 'Log_lb_13677350966184747916' 'stock' 0

DBG jobmgr/manager.go:265 creating web_log[Log_lb] job, config: map[__provider__:file reader __source__:/etc/netdata/go.d/web_log.conf autodetection_retry:0 module:web_log name:Log_lb path:/home/redacted/log/apache2/access.log priority:70000 update_every:1 url_patterns:[map[name:lb_log pattern:status.html]]] component="job manager"
DBG weblog/init.go:36 starting URL patterns creating collector=web_log job=Log_lb
ERR weblog/weblog.go:97 init failed: create pattern {Name:lb_log Match:}: empty 'name' or 'match' collector=web_log job=Log_lb
ERR module/job.go:222 init failed collector=web_log job=Log_lb
REPORT_JOB_STATUS 'web_log' 'Log_lb_13677350966184747916' 'error' 0 'job detection failed, stopping it'

I’m a bit lost, could anyone help me?

Thanks

Manu

@DeWaRs1206 hey

  1. It is not pattern but match.
  2. match pattern - see matcher syntax.
  - name: Log_lb
    path: /home/redacted/log/apache2/access.log
    url_patterns:
      - name: lb_log
        match: '* *status.html*'  # everything that contains `status.html`
      - name: user_log
        match: '!* *status.html*' # everything that doesn't contain `status.html`
1 Like