,
],
'host_git' => [
- 'sql' => preg_replace('/[\t\r\n]/','',"
- SELECT host
- ,max(updated) as last_updated
- ,min(updated) as first_updated
- ,(SELECT count(val) FROM host_info path WHERE path.host=hi.host AND path.key LIKE '%.path') as repos
- ,(SELECT max(CAST(val as INTEGER)) FROM host_info ex WHERE ex.host=hi.host AND ex.key LIKE '%.exit_code') as exit
- FROM host_info hi
- GROUP BY host ORDER BY last_updated DESC, host
-"),
- 'row_parse_pre' => function(&$row) {
+ 'sql' => preg_replace('/[\t\r\n]+/',' ',"
+ SELECT host
+ ,max(updated) as last_updated
+ ,min(updated) as first_updated
+ ,(SELECT count(path.val) FROM host_info path WHERE path.host=hi.host AND path.key LIKE 'git.%.path') as repos
+ ,max(val) as exit
+ FROM host_info hi
+ WHERE key LIKE 'git.%exit_code'
+ GROUP BY host ORDER BY last_updated DESC, host
+ "),
+ 'row_parse_pre' => function(&$row,$t) {
foreach ($row as $k=>$v) {
if (strpos($k,'updated') !== false) {
$row[$k] = preg_replace('/\..*$/','',$v);