 
 (defvar ovirt-log-analyzer-vms '())
 (make-variable-buffer-local 'ovirt-log-analyzer-vms)
+
+(defmacro ovirt-log-analyzer-while (interval condition &rest body)
+  (let ((counter (make-symbol "counter")))
+    `(let ((,counter 0))
+       (while ,condition
+         ,@body
+         (cl-incf ,counter)
+         (when (= (mod ,counter ,interval) 0)
+           (accept-process-output)
+           (sit-for 0))))))
 
 (defun ovirt-log-analyzer-show-log ()
   (interactive)

(defun ovirt-log-analyzer-filter-by-function (filter-function)
  (save-excursion
    (goto-char (point-min))
    (while (< (point) (point-max))
      (let ((beg (point))
            (end (if (funcall filter-function) (line-beginning-position) (point-max))))
        (unless (= beg end)

    (remove-overlays)
    (let ((unknown-tags '())
          (max-file-field-length 0))
      (ovirt-log-analyzer-while 50 (not (eobp))
        (when (looking-at "[0-9][^|\n]*| \\( *[^|\n]+:[0-9]+\\) *| \\( *\\([^|\n]*\\) |\\).*$")
          (let* ((beg (match-beginning 0))
                 (end (match-end 0))
