grok_exporter
grok_exporter copied to clipboard
documentation: "path" vs "paths" for file input
The documentation says "path is used if you want to monitor a single path. If you want to monitor a list of paths, use paths instead" but does not explain why.
I've inherited a grok_exporter setup that uses multiple "file" inputs, apparently successfully, and I'm interested to know why this is discouraged.
Hello, is it possible have 3 paths of logs and match some metrics with log1 and some other metrics to log 2. paths: - log0 - log1
metric - type: counter name: HTTP_Request help: number of log lines match: '*' file.path: log0
- type: counter
name: HTTP_Request
help: number of log lines
match: *
file.path: log 1
@jetpackdanger the difference between path and paths is that with path you can only specify a single value like this:
path: /tmp/example/example.log
while with paths you can specify a list of values like this
paths:
- /tmp/example/example1.log
- /tmp/example/example2.log
I think the YAML parser does not support the same key path for both a list and a single value, so I used path for the single value and paths for the list.
I'm not sure what you mean by multiple "file" inputs. Could you paste an example?
@matze1508 yes, this should be possible like this:
- type: counter
name: HTTP_Request
help: number of log lines
match: .*
path: log1
Note that match is .* and not *, because it's a regular expression and not a Glob.