|Title||Support SQL-style quoting for filtering dict-valued columns|
|Checkmk Edition||Checkmk Raw Edition (CRE)|
|Compatibility||Compatible - no manual interaction needed|
Some Livestatus columns do not contain a simple value or a list of such values, they contain a dictionary of key/value pairs. More concretely, the
columns in the
tables contain dictionary values. Livestatus filter for such columns have a special syntax:
Filter: COLUMN OPERATOR KEY VALUE
As an example, the query:
GET hosts Filter: tag = agent cmk-agent
returns all hosts where the tag "agent" has the value "cmk-agent". Note that the key and the value are separated by whitespace. But this makes it impossible to query for a tag name with spaces. To support more general keys and values in such filters, Livestatus now additionally supports SQL-style quoting for such column filters:
Filter: labels = 'It''s so' 'cool, man!'
This filter matches a label with key "It's so" and value "cool, man!". Note the use of 2 consecutive single quotes to represent 1 single quote. The previous syntax still works, the new syntax is triggered by a leading single quote in the key and/or value.