sni / lmd

Livestatus Multitool Daemon - Create livestatus federation from multiple sources
https://labs.consol.de/omd/packages/lmd/
GNU General Public License v3.0
42 stars 31 forks source link

Columns: behaves different to livestatus #137

Closed klaernie closed 1 year ago

klaernie commented 1 year ago

Sending the same LQL query to a livestatus socket and to a socket provided by lmd provides in different results:

host:/ # echo -e 'GET contacts\nColumns: name\nColumns: email\nOutputFormat: json\nColumnHeaders: on\nResponseHeader: fixed16\n' | unixcat /nagios/var/rw/lmd-livestatus|head -n2
200        8525
[["email"]
host:/ # echo -e 'GET contacts\nColumns: name\nColumns: email\nOutputFormat: json\nColumnHeaders: on\nResponseHeader: fixed16\n' | unixcat /nagios/var/rw/livestatus|head -n2
200        1494
[["name","email"],

Essentially, when using multiple LQL Columns: lines:

I noticed this in our infrastructure, and traced it back to being a different behaviour. However, I don't think can be considered a bug, since the livestatus documentation only ever shows the behaviour lmd expects. I'd probably put it down as a footnote under "known limitations".

sni commented 1 year ago

it was easier to just fix it instead of adding a footnote. Tbh, haven't seen this feature in use in the wild anywhere.

klaernie commented 1 year ago

Neither have I. Looking at the implementation, it probably took less time implement than even I took writing this issue.

Thank you very much for the very quick solution!