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

    System log - ignore messages

    Scheduled Pinned Locked Moved General pfSense Questions
    7 Posts 4 Posters 1.2k Views
    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
      • KOMK
        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
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.