Grok导出器仅在重新启动后显示更改

时间:2018-01-07 15:12:05

标签: grafana prometheus grok

我们已配置Grok导出器来监控各种系统日志中的错误。但是,一旦我们重新启动相应的grok实例,似乎会反映出更改。

请参阅下面的config.yml:

global:
    config_version: 2
input:
    type: file
    path: /ZAMBAS/logs/Healthcheck/EFT/eftcl.log
    readall: true
    poll_interval_seconds: 5

grok:
    patterns_dir: ./patterns

metrics:
    - type: gauge
      name: EFTFileTransfers
      help: Counter metric example with labels.
      match: '%{WORD:Status}\s%{GREEDYDATA:FileTransferTime};\s\\%{WORD:Customer}\\%{WORD:OutboundSystem}\\%{GREEDYDATA:File};\s%{WORD:Operation};\s%{NUMBER:Code}'
      value: '{{.Code}}'
      cumulative: false
      labels:
          Customer: '{{.Customer}}'
          OutboundSystem: '{{.OutboundSystem}}'
          File: '{{.File}}'
          Status: '{{.Status}}'
          Operation: '{{.Operation}}'
          FileTransferTime: '{{.FileTransferTime}}'

    - type: gauge
      name: EFTFileSuccessfullTransfers
      help: Counter metric example with labels.
      match: 'Success\s%{GREEDYDATA:Time};\s\\%{WORD:Customer}\\%{WORD:OutboundSystem}\\%{GREEDYDATA:File};\s%{WORD:Operation};\s%{NUMBER:Code}'
      value: '{{.Code}}'
      cumulative: false

    - type: gauge
      name: EFTFileFailedTransfers
      help: Counter metric example with labels.
      match: 'Failed\s%{GREEDYDATA:Time};\s\\%{WORD:Customer}\\%{WORD:OutboundSystem}\\%{GREEDYDATA:File};\s%{WORD:Operation};\s%{NUMBER:Code}'
      value: '{{.Code}}'
      cumulative: false

server:
    port: 9845

如果不重启,它不能反映正确的匹配模式。一旦我重新启动了grok实例,它就会完美地反映出来。

我在这里缺少一些参数吗?

由于 Priyotosh

1 个答案:

答案 0 :(得分:0)

readall部分中将input更改为false会在grok_exporter重新启动时多次停止过程行。请在Github上查看docs