diff --git a/bin/pt-agent b/bin/pt-agent index 788463f0..2b12d089 100755 --- a/bin/pt-agent +++ b/bin/pt-agent @@ -714,9 +714,14 @@ sub as_json { $json->allow_blessed([]); $json->convert_blessed([]); - return $json->encode( + my $text = $json->encode( ref $resource eq 'ARRAY' ? $resource : as_hashref($resource, %args) ); + if ( $args{json} && $text ) { # for testing + chomp($text); + $text .= "\n"; + } + return $text; } sub as_config {