Questions tagged [promtail]

Promtail is an agent which ships the contents of local logs to a private Grafana Loki instance or Grafana Cloud. Use with grafana-loki tag.

See documentation

145 questions
0
votes
1 answer

Match Grafana timestamp with the one in the log entry

I have Promtail running on one container, scraping the logs from a file. It parses them inside a pipeline, and sends them to Loki. The promtail.yaml relevant part is: - targets: - localhost labels: environment:…
0
votes
0 answers

How to handle logfile being rewritten?

I want to monitor a local log file with promtail. However the software which writes to the logfile always ends the log file with "\r\n**********\r\n" (new line, 10 asterisks and new line). The problem is that next time when the software write to the…
r .r
  • 383
  • 2
  • 9
0
votes
1 answer

customize integration timestamp in loki

I use the PLG stack (promtail, loki, grafana) to collect system logs and I need to override the integration date added by loki by the one extracted from the log message, I can't get it to work, here is my example: scrape_configs: - job_name:…
0
votes
1 answer

loki, promtail pipeline stage issue

Recently I have been testin LOKI - PROMTAIL - GRAFANA for log aggregation and analysis. I'm trying to parse my logs. A sample log looks like this [2023-04-05T00:04:18.105620+00:00] INFO: {"Code":"BGCRIF902","Message":"The backup…
0
votes
1 answer

Promtail: Expand env variable on Windows

I'm running Promtail on Windows, using environment variables as described here: https://grafana.com/docs/loki/latest/clients/promtail/configuration/#use-environment-variables-in-the-configuration . Here is my config.yaml: client: …
iAmoric
  • 1,787
  • 3
  • 31
  • 64
0
votes
0 answers

Retry option for promtail log watcher

In one of the Kubernetes deployment, the promtail runs as side car container and is responsible for watching the application log file on shared (emptyDir) Kubernetes volume. In particular scenario Promtail agent container starts before application…
0
votes
0 answers
0
votes
0 answers

promtail as service on windows behaves differently than run directly

Somehow there seems to be a difference on how to run promtail on Windows. Run directly via promtail.exe --config.file=config.yml it works. It adds targets, and starts scanning: Started via nssm as a service, service is running, stderr redirected…
user2366975
  • 4,350
  • 9
  • 47
  • 87
0
votes
1 answer

How to set default value for regular in Promtail configueration

I have Docker swarm of 3 nodes where are running monitoring apps (exporters, grafana, etc..) per evironment (dev, stg and prd). Dev an stg containers contains __ in their container name, so for dev its _dev_ and for stg its _stg_. Prd…
dorinand
  • 1,397
  • 1
  • 24
  • 49
0
votes
0 answers

Promtail using consul as service discovery doesn't work the labels

I'm configuring Promtail to use Consul's Service Discovery and when I put the labels to define which directory I'm going to get the logs from, I get this error when starting Promtail: promtail[10203]: line 23: field labels not found in type…
Daniel Fulgido
  • 97
  • 2
  • 13
0
votes
0 answers

How can I make Grafana:Loki parse through HAProxy Logs and appropriately assign labels to specific line items in the log?

I'm trying to get Grafana:Loki & PromTail working in my environment. Our goal is to pull information from /var/logs/haproxy.log to track the traffic hitting each of our servers. Specifically, client IP addresses so we can graph it out over time.…
GenEle
  • 1
  • 1
0
votes
0 answers

Using variables in YML file such as $date

I want to use the date variable inside a yml file from is this possible? job_name: BackupLogs static_configs: - targets: - localhost labels: job: backuplogs __path__: /var/backups/backupsql/logs/$(date +%m-%Y)/log-$(date…
0
votes
1 answer

uploading local logs to loki through promtail

I wanted to upload local .logs to grafana through loki using promtail. My promtail shows that the files are in, but in Grafana, it is not shown. I've tried configurating the loki and promtail config files. There hasn't been much results.
0
votes
0 answers

scrape two messages with different format in the same log file with promtail

I have a log file in json format (generated by logback but not relevant) that has two different message types: 452 { 453 "timestamp" : "2022-10-25 14:37:50.389", 454 "level" : "INFO", 455 "thread" : "http-nio-38080-exec-10", …
Illidan
  • 149
  • 1
  • 8
0
votes
0 answers

Options for writing useful logs for an agent such as promtail

I have a java/spring-boot/log4j2 application on an architecture of : app -> promtail -> loki -> grafana Currently, my application has a friendly log message system to be read in a console by a developer, nothing ready to search or that really has…
Illidan
  • 149
  • 1
  • 8