loki.source.file "b3d_vol" { targets = [{ __path__ = "E:/3dnet/audits/vol/B3DWEB*.log", job = "affidea", log_type = "VOL", host = constants.hostname, environment = "production", }] file_match { enabled = true sync_period = "5s" ignore_older_than = "24h" } forward_to = [loki.process.b3dweb.receiver] } loki.source.file "b3d_iis" { targets = [{ __path__ = "E:/3dnet/audits/iis/B3DWEB*.log", job = "affidea", log_type = "IIS", host = constants.hostname, environment = "production", }] file_match { enabled = true sync_period = "5s" ignore_older_than = "24h" } forward_to = [loki.process.b3dweb.receiver] } loki.process "b3dweb" { // Join stack traces and other multiline entries into one event. stage.multiline { firstline = "^[A-Z]+ \\d{4}\\.\\d{2}\\.\\d{2} \\d{2}:\\d{2}:\\d{2}" max_wait_time = "3s" max_lines = 512 } stage.regex { expression = "^(?P[A-Z]+) (?P\\d{4}\\.\\d{2}\\.\\d{2} \\d{2}:\\d{2}:\\d{2})(?: (?P\\S+) -)? (?P[\\s\\S]*)$" } stage.template { source = "level" template = "{{ if eq .Value \"EXCEPTION\" }}error{{ else if eq .Value \"WARNING\" }}warn{{ else if eq .Value \"INF\" }}info{{ else }}{{ ToLower .Value }}{{ end }}" } stage.timestamp { source = "timestamp" format = "2006.01.02 15:04:05" location = "Europe/London" action_on_failure = "skip" } stage.labels { values = { level = "level", component = "component", } } stage.output { source = "message" } forward_to = [loki.write.central.receiver] } loki.write "central" { endpoint { url = "https://logs.3dnetmedical.com/loki/api/v1/push" basic_auth { username = "alloy" password = "pe1IhHWZ0vOCJ90Z" } } }