function [ L ] = extract_line_capture_runs( syslog )


start = {'terminal guidance.'};
finish_suc = {'Docking sequence complete at range'};
finish_time = {'Started mission Default', 'Timed out while trying to dock at range'};
finish_miss = {'Rolling out.', 'Rollout at range', 'Rollout to start WP'};
re_init = { 'ProNav REINIT' };

key = [start finish_suc finish_time finish_miss re_init];

slog = syslog(contains(syslog, key, 'IgnoreCase', true));
slog = slog(~contains(slog, '<') & contains(slog, {'IMPORTANT', 'FAULT', 'INFO', 'ERROR'}));

N = length(slog);
ct = 0;
L = NaN(N, 3);
for k = 1:length(slog)
   
    l = slog(k);
    
    % Skip ahead to the first terminal guidance start
    if ct == 0 && ~contains(l, start, 'IgnoreCase', true)
        continue
    end
    
    
    % Terminal guidance start
    if contains(l, start, 'IgnoreCase', true)
        ct = ct + 1;
        L(ct, 1) = syslog2datenum(l);
    
    % Docking sucess
    elseif contains(l, finish_suc) && isnan(L(ct, 2)) && isnan(L(ct, 3))
        L(ct, 2) = syslog2datenum(l);
    
    % Docking miss
    elseif contains(l, finish_miss) && ct > 0 && isnan(L(ct, 2)) && isnan(L(ct, 3))
        L(ct, 3) = syslog2datenum(l);
    
    % Docking mission end
    elseif contains(l, finish_time) && ct > 0 && isnan(L(ct, 2)) && isnan(L(ct, 3))
        ct = ct - 1;
    end
    
end

L(isnan(L(:,1)),:) = [];

end