Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Glob for files #176

Closed
Gui13 opened this issue Jan 28, 2021 · 1 comment · Fixed by #180
Closed

Allow Glob for files #176

Gui13 opened this issue Jan 28, 2021 · 1 comment · Fixed by #180

Comments

@Gui13
Copy link
Contributor

Gui13 commented Jan 28, 2021

Is your feature request related to a problem? Please describe.

My nginx issues many logfiles, one per domain name, in the following simplified hierearchy:

/var/log/nginx/client1/${domain_name}_access.log

Where domain_name has many values and changes regularly (we have a dynamic inventory of domain names and the configuration is added automatically in nginx).

I have to manually add all files to the files = [ x, y, z ] for each of my clients, eg:

namespaces:
  - name: client&
    format: '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $upstream_connect_time'
    source:
      files:
        - /var/log/nginx/client1/xxx_access.log
        - /var/log/nginx/client1/yyy_access.log
        - a dozen more

Describe the solution you'd like

I'd like the files to be "globable" like this:

namespaces:
  - name: client&
    format: '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $upstream_connect_time'
    source:
      files:
        - /var/log/nginx/client1/(.*)_access.log  # automatically picks up all files matching this pattern at boot and on SIGHUP

Describe alternatives you've considered

I could spin up some kind of patching to the current configuration so that when an new nginx configuration (and logfile) is added, I can add it to the corresponding namespace, but I am not quite sure how much effort it would entice, rather than implement a basic globing in nginxlog-exporter for that feature.

We run bare-metal, not kubernetes. In a K8S environment, I'd have considered adding CRDs maybe to symbolize a namespace and dynamically poplate the configuration with that.

Additional context

@helmich-bot
Copy link
Collaborator

There has not been any activity to this issue in the last 30 days. It will automatically be closed after 7 more days. Remove the stale label to prevent this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants