Closed jeremydenoun closed 7 years ago
what would you expect it to do???
seems like an error to me
Hi Cameron,
I expect no error because no content output isn't an error.
What do you suggest if I have a script who can generate a metric or not ? (maybe change config and restart telegraf without my "empty content" script and rechange when metrics comeback ? but this can restart telegraf very often)
This is an issue for me because I supervise logfile and this error is print each period on collect
Thanks for your help
It sounds to me like you really need something like the logparser input but with access to the data_format
parsers?
Or perhaps the tail input would work?
not really or I don't understand something but for help you to understand my issue, my script look like :
if [ "$var" -eq XX ]; then
echo "Metrics A"
elif [ "$var" -eq YY ]; then
echo "Metrics B"
else
#I don't want any metrics in this case
fi
and in the 'else' case I have a script output empty content (so emit warning in telegraf log).
I can't remove my script in empty case because the '$var' can change between execution, so I need to find a way to clean this "false" warning without hack my log detection.
Thanks
The solution in your PR is a good addition, I was just curious if one of the logfile streaming inputs would be more convenient if it were able to filter your log into one of the data_format
. That way you wouldn't need to reopen and reposition in the file stream on every gather. To be clear, the exec plugin is the only current way that I know of to accomplish your task.
Descriptions
Since 1.2.1 (but maybe before because I jump from 1.0.1 -> 1.2.1) If I setup an input.exec source with an empty output I have an error with in log :
with a valid data we don't have this error
Relevant telegraf.conf:
empty_metrics.sh (emit error) :
and if I change for
no errors
System info:
telegraf 1.2.1 / debian 8.1 / debian official package