Below is my promtail configuration. I’m sending IIS logs from promtail to Loki and visualizing them in Grafana
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: D:\Logging\var\log\positions.yaml
client:
url: http://localhost:3100/loki/api/v1/push
scrape_configs:
-
job_name: iislogsjob
static_configs:
-
targets:
- localhost
labels:
job: iislogsjob
host: 192.168.0.200
env: pc_server
path: “C:/inetpub/logs/LogFiles/W3SVC*/*.log”
pipeline_stages:
-
match:
selector: ‘{job=“iislogsjob”}’
stages:
-
regex:
expression: ‘(?P\S+ \S+) \S+ \S+ (?P<server_ip>\S+) (?PGET|POST) (?P.?) \S+ (?P\d+) - (?P\S+) (?P<http_version>\S+) (?P.?) (?P:- -|\S+) (?P\S+) (?P\d+) .*’
-
timestamp:
source: timestamp
format: 2006-01-02 15:04:05
-
labels:
timestamp:
method:
-
-