You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In other words, metrics are pushed to stdin as JSON objects, but without newlines is imposible for scripts to know how to delimit those objects. Not sure if the right solution is to add the newline in the batch JSON serializer (looks dirty, but that's current behavior for the simple serializer), or adding it in the execd output.
The text was updated successfully, but these errors were encountered:
carlosabalde
changed the title
execd output with use_batch_format = true is broken due to missing trailing newline
execd output with JSON format & use_batch_format = true is broken due to missing trailing newline
Oct 18, 2023
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf 1.28.2 + Ubuntu 22.04
Docker
No response
Steps to reproduce
Use the suggested minimal configuration, being
/tmp/foo.sh
something like this:Expected behavior
Output logged to
/tmp/foo.log
, one JSON object per line.Actual behavior
Nothing logged to
/tmp/foo.log
.Additional info
Problem is, unlike the simple JSON serializer, the batch JSON serializer doesn't append a trailing newline. As a result, the execd output writes the serialized string to the
stdin
of the script, but without a newline, the script will never consume it.In other words, metrics are pushed to
stdin
as JSON objects, but without newlines is imposible for scripts to know how to delimit those objects. Not sure if the right solution is to add the newline in the batch JSON serializer (looks dirty, but that's current behavior for the simple serializer), or adding it in the execd output.The text was updated successfully, but these errors were encountered: