Hello all,
I am trying to find a way to which I want to be able to view a certain log file based on the selection of an instance. I am using Loki, promtail and prometheus. For example, lets say there are 3 instances and the log file I want to monitor using loki is the syslog. So if I select instance 1, the syslog file for instance 1 will show. If then select instance 2 then the syslog file for instance 2 will show. And so on.
my config-promtail.yml is as follows:
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
clients:
- url: http://127.0.0.1:3100/loki/api/v1/push
scrape_configs:
- job_name: syslog
pipeline_stages:
static_configs:
- targets:
- localhost
labels:
job: syslog
host: instance1
agent: promtail
__path__: /var/log/syslog
I have tried in my loki datasource:
{job=“syslog”, instance=~"$instance"}
Any ideas what is the best way to accomplish this?