Catch a string in log

Hello,

I’m looking for a way tail a log file (Linux + Win) and catch a string pattern or a regex,
then send a notification on it.
I have found some data about input.tail plugin but I’m still not sure how to make it work.

Thank you
Nati

Hello @natim,
Here are some resources/steps that might be helpful to you:

  1. Get started with Telegraf | Telegraf 1.21 Documentation
  2. telegraf -sample-config -input-filter file -output-filter influxdb > file.conf
  3. Change the data format in the file.conf
## Data format to consume. 
data_format = "<your format>"  

You can select from the following formats:

4. Finish altering your conifg as needed.
5. Debugging: Use the --test flag gather metrics once and print them. Like telegraf --config $pwd/file.conf --test. Also include in the agent part of your config debug=true.