Livestatus\Query: fetch csv, not json

This commit is contained in:
Thomas Gelf 2014-11-16 15:28:17 +01:00
parent 23546a4224
commit 14cdcc8ce2
1 changed files with 10 additions and 1 deletions

View File

@ -82,9 +82,18 @@ class Query extends SimpleQuery
if ($this->table === null) {
throw new IcingaException('Table is required');
}
// Headers we always send
$default_headers = array(
'OutputFormat: json',
// Our preferred output format is CSV as it allows us to fetch and
// process the result row by row
'OutputFormat: csv',
'ResponseHeader: fixed16',
// Tried to find a save list of separators, this might be subject to
// change and eventually be transforment into constants
'Separators: ' . implode(' ', array(ord("\n"), ord('`'), ord(','), ord(';'))),
// We always use the keepalive feature, connection teardown happens
// in the connection destructor
'KeepAlive: on'
);
$parts = array(