scrape_configs: - job_name: example_job static_configs: - targets: - localhost labels: __path__: /var/log/*.log pipeline_stages: - regex: expression: ".*ERROR.*" # 正则表达式匹配包含 "ERROR" 的日志行 action: drop # 丢弃匹配的日志行 在这个例子中,任何包含 "ERROR" 的日志行都会被过...
But labels from the regex stage are not applied when using traditional framing. (I will just keep using octet-counted.) Thanks a lot again. ghost closed this as completedon Jul 2, 2020 adityacs commented on Jul 2, 2020 adityacs on Jul 2, 2020 Contributor @g574 Glad that your issue...
[ replacement: <string> |default= $1]# 根据正则匹配结果执行的动作[ action: <relabel_action> |default= replace ] <regex>是任何有效的 RE2 正则表达式,它是 replace、keep、drop、labelmap、labeldrop 和 labelkeep 操作的必要条件,该正则表达式在两端都是固定的,要取消对正则的锚定,请使用.*<regex>.*...
# Example:"Application""System""Security"[eventlog_name:<string>|default=""]# xpath_query可以是定义的缩写形式,例如"Event/System[EventID=999]",更多 XPath 查询语法请参考: # https://docs.microsoft.com/en-us/windows/win32/wes/consuming-events[xpath_query:<string>|default="*"]# 书签包含目标...
# 例如:http://example.com:3100/loki/api/v1/pushurl:<string># 默认使用的租户ID,用于推送日志到 Loki。 # 如果省略或为空,则会假设 Loki 在单租户模式下运行,不发送X-Scope-OrgID 头。[tenant_id:<string>]# 发送一批日志前的最大等待时间,即使该批次日志数据未满。[batchwait:<duration>|default=1s...
在大多数情况下,你用 regex 或json 阶段从日志中提取数据,提取的数据被转化为一个临时的字典 Map 对象,然后这些数据是可以被 promtail 使用的,比如可以作为标签的值或作为输出。此外,除了 docker 和 cri 之外,任何其他阶段都可以访问提取的数据。 loki_push_api loki_push_api 属性配置 Promtail 来暴露一个 ...
上面的多行解析配置中除了 format_firstline 指定多行日志的开始行匹配之外,还用到了 format1、format2…formatN 这样的配置,其中 N 的范围是 1...20,是多行日志的 Regexp 格式列表,为了便于配对,可以将 Regexp 模式分割成多个 regexpN 参数,将这些匹配模式连接起来构造出多行模式的正则匹配。
name:pod-logskubernetes_sd_configs:-role:podpipeline_stages:-docker:{}relabel_configs:-source_labels:-__meta_kubernetes_pod_node_nametarget_label:__host__-action:labelmapregex:__meta_kubernetes_pod_label_(.+)-action:replacereplacement:$1separator:/source_labels:-__meta_kubernetes_namespace-__...
Example: In telegraf there is a rule/option that forces the process to look only at the last file: from_begining: false (or something like that..) Is there anything similar for promtail? I can understand that promtail use the positions file to know which files he have to look, but ho...
# Loki监听的URL,在Loki中表示为http_listen_address和http_listen_port # 如果Loki在微服务模式下运行,如下是HTTP示例:http://example.com:3100/loki/api/v1/pushurl:<string># CustomHTTPheaders to be sent alongwitheach push request.# Be aware that headers that aresetby Promtailitself(...