Shrink & spoiler large service check plugin output

Hi,
thanks a lot for that interesting plugin suggestion!
This looks like the first step to a well working solution, but so far I am not there.

When setting the WRAPPED_OUTPUT variable to $null or just shorten it by X characters, the performance data in Icinga will be lost. So performance data is not displayed anymore in this case.

But I want to keep this:
2021-07-29_16-24-58
Is there any other way (using this script) to keeping the performance data, while the output will be displayed for just one or two lines?

That’s quiet interesting!
When implementing an error, the service check preview is shortened to the error output only, but the plugin output itself is enriched by the error output, but the performance data stays!