We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[[inputs.tail]] files = ["test.log"] from_beginning = false data_format = "influx" [[processors.regex]] namepass = "notalert" [[processors.regex.tags]] key = "source" pattern = "^.*/.*/([\\d]+)$" replacement = "${1}" result_key = "instance"
RHEL Linux 4.4.75-el6.x86_64.lime.1 Telegraf 1.9.2
Using log data generator:
#!/bin/bash rm -f test.log while [ 1 ] do num=$(( ( RANDOM % 100 ) + 1 )) echo 'alert,host=localhost,severity=INFO,source=blah/test/'$num',type=1 data="blah blah blah" '$(date +%s%N) >> test.log sleep 1 done
use telegraf config above
lines from inputs.tail with metric name alert should not have the instance tag added by the processor regex which has namepass=notalert
alert
instance
regex
namepass=notalert
all output entries have instance tag regardless of metric name
test.log:
alert,host=localhost,severity=INFO,source=blah/test/94,type=1 data="blah blah blah" 1548182801985227789 alert,host=localhost,severity=INFO,source=blah/test/31,type=1 data="blah blah blah" 1548182802987834242 alert,host=localhost,severity=INFO,source=blah/test/97,type=1 data="blah blah blah" 1548182803989886698 alert,host=localhost,severity=INFO,source=blah/test/78,type=1 data="blah blah blah" 1548182804991547174
telegraf stdout:
2019-01-22T18:46:49Z I! Starting Telegraf 1.9.2 2019-01-22T18:46:49Z I! Loaded inputs: inputs.tail 2019-01-22T18:46:49Z I! Loaded aggregators: 2019-01-22T18:46:49Z I! Loaded processors: regex 2019-01-22T18:46:49Z I! Loaded outputs: file 2019-01-22T18:46:49Z I! Tags enabled: host=localhost 2019-01-22T18:46:49Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"localhost", Flush Interval:600ms alert,host=localhost,instance=94,path=test.log,severity=INFO,source=blah/test/94,type=1 data="blah blah blah" 1548182801985227789 alert,host=localhost,instance=31,path=test.log,severity=INFO,source=blah/test/31,type=1 data="blah blah blah" 1548182802987834242 alert,host=localhost,instance=97,path=test.log,severity=INFO,source=blah/test/97,type=1 data="blah blah blah" 1548182803989886698 alert,host=localhost,instance=78,path=test.log,severity=INFO,source=blah/test/78,type=1 data="blah blah blah" 1548182804991547174
The text was updated successfully, but these errors were encountered:
Nevermind. After debugging it looks like nampass expects an array.
Sorry, something went wrong.
Sorry about this, I think the lack of error is related to #3444
No branches or pull requests
Relevant telegraf.conf:
System info:
RHEL Linux 4.4.75-el6.x86_64.lime.1
Telegraf 1.9.2
Steps to reproduce:
Using log data generator:
use telegraf config above
Expected behavior:
lines from inputs.tail with metric name
alert
should not have theinstance
tag added by the processorregex
which hasnamepass=notalert
Actual behavior:
all output entries have
instance
tag regardless of metric nameAdditional info:
test.log:
telegraf stdout:
The text was updated successfully, but these errors were encountered: