Files
configpolicy/group_vars/nextcloud.yml
Dustin C. Hatch 9bea8e1ce7 nextcloud: Scrape logs with Promtail
Nextcloud writes JSON-structured logs to
`/var/lib/nextcloud/data/nextcloud.log`.  These logs contain errors,
etc. from the Nextcloud server, which are useful for troubleshooting.
Having them in Loki will allow us to view them in Grafan as well as
generate alerts for certain events.
2024-10-13 18:05:50 -05:00

55 lines
1.5 KiB
YAML

nextcloud_server_name: nextcloud.pyrocufflink.net
apache_server_name: '{{ nextcloud_server_name }}'
nextcloud_trusted_proxies:
- 127.0.0.1
- ::1
- '{{ lookup("dig", groups["public-web"][0]) }}'
nextcloud_trusted_domains:
- nextcloud.pyrocufflink.net
- nextcloud.pyrocufflink.blue
- '{{ ansible_fqdn }}'
nextcloud_smtp:
from: nextcloud@pyrocufflink.net
host: mail.pyrocufflink.blue
port: 25
dnf_automatic_exclude: nextcloud
nextcloud_db_host: postgresql.pyrocufflink.blue;sslcert=/etc/nextcloud/postgresql.cer;sslkey=/etc/nextcloud/postgresql.key;sslrootcert=system;sslmode=verify-full
restic_include:
- /var/lib/nextcloud
restic_exclude:
- /var/lib/nextcloud/data/*/files_trashbin
- /var/lib/nextcloud/.snapshots
promtail_dac_read_search: true
promtail_scrape_configs:
- '{{ promtail_default_scrape.journal }}'
- job_name: nextcloud
static_configs:
- labels:
__path__: /var/lib/nextcloud/data/nextcloud.log*
job: nextcloud
pipeline_stages:
- json:
expressions:
timestamp: time
level: level
- timestamp:
source: timestamp
format: '2006-01-02T15:04:05-07:00'
- labels:
level:
- job_name: nextcloud-updater
static_configs:
- labels:
__path__: /var/lib/nextcloud/data/updater.log
job: nextcloud-updater
pipeline_stages:
- regex:
expression: >-
^(?P<timestamp>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{4})
- timestamp:
source: timestamp
format: '2006-01-02T15:04:05-0700'