def rsyslog_get_cef_log_counter():
    '''
    Count using tac and wc -l the amount of CEF messages arrived and see it is in increasing
    count
    :return:
    '''
    print("Validating the CEF\\ASA logs are received and are in the correct format when received by syslog daemon")
    print_notice("sudo tac /var/log/syslog")
    tac = subprocess.Popen(["sudo", "tac", syslog_log_dir[0]], stdout=subprocess.PIPE)
    grep = subprocess.Popen(["grep", "-E", "CEF\|ASA"], stdin=tac.stdout, stdout=subprocess.PIPE)
    count_lines = subprocess.Popen(["wc", "-l"], stdin=grep.stdout, stdout=subprocess.PIPE)
    o, e = count_lines.communicate()
    output = o.decode(encoding='UTF-8')
    if e is None:
        print("Located " + str(output) + " CEF\\ASA messages")
        return int(output)
    elif "No such file or directory" in output:
        print("Validating the CEF\\ASA logs are received and are in the correct format when received by syslog daemon")
        print_notice("sudo tac /var/log/messages")
        tac = subprocess.Popen(["sudo", "tac", syslog_log_dir[1]], stdout=subprocess.PIPE)
        grep = subprocess.Popen(["grep", "-E", "CEF\|ASA"], stdin=tac.stdout, stdout=subprocess.PIPE)
        count_lines = subprocess.Popen(["wc", "-l"], stdin=grep.stdout, stdout=subprocess.PIPE)
        o, e = count_lines.communicate()
        output = o.decode(encoding='UTF-8')
        if e is None:
            print("Located " + str(output) + " CEF messages")
            return int(output)
    print_error("Error: could not find CEF\\ASA logs.")
    print_notice("Notice: execute \"sudo tac /var/log/syslog or /var/log/messages | grep -E \"CEF|ASA\" -m 10\" manually.")
    return 0

    Count using tac and wc -l the amount of CEF messages arrived and see it is in increasing
    count
    :return:
    
DataConnectors/CEF/cef_troubleshoot.py