Skip to content

HakaiInstitute/hakai-erddap-telegraf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cwatch-telegraf

telegraf log wrangling see https://www.influxdata.com/time-series-platform/telegraf/ for more details on teleraf

Quick Start

create env file

cp .env.sample .env

edit .env values. This to check are

  • LOG_FILE - this should point to the nginx or apache log folder. not directly to a file.
  • HOST_URL - hostname to report in plausible with protocol
  • DOMAINS - keys used by plausible to route events see https://plausible.io/docs/events-api#request-body-json-parameters
  • PLAUSIBLE_URL - url to plausible instance
  • SENTRY_URL - url to sentry project for monitering up time

review telegraf/telegraf.conf. the most important one being

  • files under [[inputs.tail]]

find the group that has read access to the log files

stat -c '%g' /var/log/apache2

use the resulting number to set the group in the telegraf container by editing the docker compose and adding

user: telegraf:4

where 4 is the gid of the group

Start the container

sudo docker-compose up -d

TODO

  • create a telegraf conf for nginx
  • log file name is hard coded i.e. catalogue-ssl-access.log. it would be nice to make it based on an environment variable.

About

Telegraf log wrangling for erddap hosted on apache or nginx

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 63.0%
  • Dockerfile 32.8%
  • Shell 4.2%