Navigation

    Netgate Discussion Forum
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    System log - ignore messages

    General pfSense Questions
    4
    7
    614
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      Rezin last edited by

      Is it possible to ignore specific messages being logged?

      1 Reply Last reply Reply Quote 0
      • KOM
        KOM last edited by

        Not really.  The Settings page allows you to not log some events.  A better solution for you might be to log everything to an external syslog server and then filter from there.

        1 Reply Last reply Reply Quote 0
        • C
          cmb last edited by

          What's being logged that you want to ignore?

          1 Reply Last reply Reply Quote 0
          • R
            Rezin last edited by

            @cmb:

            What's being logged that you want to ignore?

            The error messages from this thread, although I made a patch as a bandaid fix:

            --- /usr/local/www/diag_logs.php
            +++ /usr/local/www/diag_logs.php
            @@ -108,15 +108,15 @@
            
             					if($filtertext)
            -						dump_clog($system_logfile, $nentries, true, array("$filtertext"), array("ppp"));
            +						dump_clog($system_logfile, $nentries, true, array("$filtertext"), array("ppp|sa6_recoverscope"));
             					else
            -						dump_clog($system_logfile, $nentries, true, array(), array("ppp"));
            +						dump_clog($system_logfile, $nentries, true, array(), array("ppp|sa6_recoverscope"));
             				?>
            
             					  | 				 				 				
            
            <form id="filterform" name="filterform" action="diag_logs.php" method="post" style="margin-top: 14px;">
                           				" />
             						</form>
            
            Maybe a new field can be put beside the "Filter" field (on diag_logs.php) for dump_clog's "$grepinvert". |
            
            
            1 Reply Last reply Reply Quote 0
            • N
              NOYB last edited by

              Think the advanced log filtering in 2.3 will allow that to be filtered out (excluded).

              1 Reply Last reply Reply Quote 0
              • N
                NOYB last edited by

                Something like this should allow search to be inverted by preceding the search term with an exclamation point as the first character.

                That way it can be used for anything rather than a hard coded string.

                
                --- /usr/local/www/guiconfig.inc
                +++ /usr/local/www/guiconfig.inc
                @@ -603,13 +603,17 @@
                 function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert = "") {
                 	global $g, $config;
                 	$sor = isset($config['syslog']['reverse']) ? "-r" : "";
                 	$logarr = "";
                 	$grepline = "  ";
                 	if(is_array($grepfor))
                +		if ((strpos($grepfor[0], '!') === 0)) {
                +			$grepfor[0] = substr($grepfor[0], 1);
                +			$invert = '-v';
                +		}
                -		$grepline .= " | /usr/bin/egrep " . escapeshellarg(implode("|", $grepfor));
                +		$grepline .= " | /usr/bin/egrep $invert " . escapeshellarg(implode("|", $grepfor));
                 	if(is_array($grepinvert))
                 		$grepline .= " | /usr/bin/egrep -v " . escapeshellarg(implode("|", $grepinvert));
                 	if (is_dir($logfile)) {
                 		$logarr = array("File $logfile is a directory.");
                 	} elseif (file_exists($logfile) && filesize($logfile) == 0) {
                 		$logarr = array("Log file started.");
                
                
                1 Reply Last reply Reply Quote 0
                • R
                  Rezin last edited by

                  Thanks, I'll add that one too.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  Products

                  • Platform Overview
                  • TNSR
                  • pfSense
                  • Appliances

                  Services

                  • Training
                  • Professional Services

                  Support

                  • Subscription Plans
                  • Contact Support
                  • Product Lifecycle
                  • Documentation

                  News

                  • Media Coverage
                  • Press
                  • Events

                  Resources

                  • Blog
                  • FAQ
                  • Find a Partner
                  • Resource Library
                  • Security Information

                  Company

                  • About Us
                  • Careers
                  • Partners
                  • Contact Us
                  • Legal
                  Our Mission

                  We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

                  Subscribe to our Newsletter

                  Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

                  © 2021 Rubicon Communications, LLC | Privacy Policy