-
Notifications
You must be signed in to change notification settings - Fork 153
Open
Description
How can I have it so I search if a string exists in a log file
tired something like this
global:
config_version: 3
input:
type: file
path: /var/logs/logfile.log
readall: true
metrics:
- type: gauge
name: error_in_log
help: Error has been found in log.
match: 'error'
value: '{{if "error"}}1{{else}}0{{end}}'
labels:
logfile: '{{base .logfile}}'
server:
port: 9144
if the string error is found in log file error_in_log will have the value of 1
Metadata
Metadata
Assignees
Labels
No labels