Service short and long output


How can I get output and long_output data as a variable? We see this data on the “Source” tab in the “Volatile State Details” section. This is needed for our notifications plugin.

The $service.output$ variable works, but returns full information (output + long_output ). I tried using $service.state.output$ and $service.state.long_output$ variables, but they don’t work (the value of the $service.state$ variable is returned)

Icinga 2 does not make a difference between output (first line) and long_output (remaining lines) like in Icinga 1.x. Performance Data is provided separately.
There is no output length restriction as known from Icinga 1.x using an 8KB static buffer.
The IdoMysqlConnection and LivestatusListener types split the raw output into output (first line) and long_output (remaining lines) for compatibility reasons."

Check Output

In a icinga var way you can not access this.
In a module these 2 “outputs” are accessable

but you can try to use the icingadsl and split the checkoutput:

Thanks for the answer. But I didn’t quite understand how to do this. Can you give an example using the data from the screenshot?

can you give an example how you previously used these vars?