Path: blob/main/docs/sources/static/configuration/logs-config.md
4096 views
---
---
logs_config
The logs_config
block configures how the Agent collects logs and sends them to a Loki push API endpoint. logs_config
is identical to how Promtail is configured, except deprecated fields have been removed and the server_config is not supported.
Refer to the Promtail documentation for the supported values for these fields.
global_config
The global_config
block configures global values for all launched Loki Promtail instances.
Note: More information on the following types can be found on the documentation for Promtail:
file_watch_config
The file_watch_config
block configures how often to poll log files from disk for changes:
logs_instance_config
The logs_instance_config
block is an individual instance of Promtail with its own set of scrape rules and where to forward logs. It is identical to how Promtail is configured, except deprecated fields have been removed and the server_config
block is not supported.
Note: More information on the following types can be found on the documentation for Promtail:
Note: Backticks in values are not supported.
Note: Because of how YAML treats backslashes in double-quoted strings, all backslashes in a regex expression must be escaped when using double quotes. But because of double processing, in Grafana Agent config file you must use quadruple backslash (
\\\\
) construction to add backslashes into regular expressions, here is example forname=(\w+)\s
regex:
Using single or double backslash construction produces the error:
Using backticks produces the error: