Go to Grafana agent git repo, and download the latest release or use the following command to download for Debian
wget https://github.com/grafana/agent/releases/download/v0.38.1/grafana-agent-0.38.1-1.amd64.deb
install the agent
dpkg -i grafana-agent-0.38.1-1.amd64.deb
Edit grafana-agent configuration file /etc/grafana-agent.yaml
loki:
configs:
- name: default
positions:
filename: /tmp/positions.yaml
scrape_configs:
- job_name: varlogs
static_configs:
- targets: [localhost]
labels:
job: varlogs
__path__: /var/log/*log
- job_name: freeswitch
static_configs:
- targets: [localhost]
labels:
job: fslogs
__path__: /home/hrhashmi/FREESWITCH/var/log/freeswitch/freeswitch.log
clients:
- url: http://qryn.hbvoice.local:3100/loki/api/v1/push
basic_auth:
username: default
password: clickpass
Start grafana-agent
systemctl start grafana-agent
Enjoy ;)