Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 18.220.9.180
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/augeas/lenses/dist/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/augeas/lenses/dist/tests/test_rsyslog.aug
(*
Module: Test_Rsyslog
  Provides unit tests and examples for the <Rsyslog> lens.
*)

module Test_Rsyslog =

(* Variable: conf *)
let conf = "# rsyslog v5 configuration file

$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$ModLoad imklog   # provides kernel logging support (previously done by rklogd)
$UDPServerRun 514
$InputTCPServerRun 514
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$ActionFileEnableSync on
$IncludeConfig /etc/rsyslog.d/*.conf

*.info;mail.none;authpriv.none;cron.none                /var/log/messages
authpriv.*                                              /var/log/secure
*.emerg                                                 *
*.*    @2.7.4.1
*.*    @@2.7.4.1
*.emerg :omusrmsg:*
*.emerg :omusrmsg:foo,bar
"

(* Test: Rsyslog.lns *)
test Rsyslog.lns get conf =
  { "#comment" = "rsyslog v5 configuration file" }
  {  }
  { "$ModLoad" = "imuxsock"
    { "#comment" = "provides support for local system logging (e.g. via logger command)" }
  }
  { "$ModLoad" = "imklog"
    { "#comment" = "provides kernel logging support (previously done by rklogd)" }
  }
  { "$UDPServerRun" = "514" }
  { "$InputTCPServerRun" = "514" }
  { "$ActionFileDefaultTemplate" = "RSYSLOG_TraditionalFileFormat" }
  { "$ActionFileEnableSync" = "on" }
  { "$IncludeConfig" = "/etc/rsyslog.d/*.conf" }
  {  }
  { "entry"
    { "selector"
      { "facility" = "*" }
      { "level" = "info" }
    }
    { "selector"
      { "facility" = "mail" }
      { "level" = "none" }
    }
    { "selector"
      { "facility" = "authpriv" }
      { "level" = "none" }
    }
    { "selector"
      { "facility" = "cron" }
      { "level" = "none" }
    }
    { "action"
      { "file" = "/var/log/messages" }
    }
  }
  { "entry"
    { "selector"
      { "facility" = "authpriv" }
      { "level" = "*" }
    }
    { "action"
      { "file" = "/var/log/secure" }
    }
  }
  { "entry"
    { "selector"
      { "facility" = "*" }
      { "level" = "emerg" }
    }
    { "action"
      { "user" = "*" }
    }
  }
  { "entry"
    { "selector"
      { "facility" = "*" }
      { "level" = "*" }
    }
    { "action"
      { "protocol" = "@" }
      { "hostname" = "2.7.4.1" }
    }
  }
  { "entry"
    { "selector"
      { "facility" = "*" }
      { "level" = "*" }
    }
    { "action"
      { "protocol" = "@@" }
      { "hostname" = "2.7.4.1" }
    }
  }
  { "entry"
    { "selector"
      { "facility" = "*" }
      { "level" = "emerg" }
    }
    { "action"
      { "omusrmsg" = "*" }
    }
  }
  { "entry"
    { "selector"
      { "facility" = "*" }
      { "level" = "emerg" }
    }
    { "action"
      { "omusrmsg" = "foo" }
      { "omusrmsg" = "bar" } }
  }

(* Parse complex $template lines, RHBZ#1083016 *)
test Rsyslog.lns get "$template SpiceTmpl,\"%TIMESTAMP%.%TIMESTAMP:::date-subseconds% %syslogtag% %syslogseverity-text%:%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\\n\"\n" =
  { "$template" = "SpiceTmpl,\"%TIMESTAMP%.%TIMESTAMP:::date-subseconds% %syslogtag% %syslogseverity-text%:%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\\n\"" }

(* Parse property-based filters, RHBZ#1083016 *)
test Rsyslog.lns get ":programname, startswith, \"spice-vdagent\" /var/log/spice-vdagent.log;SpiceTmpl\n" =
  { "filter"
    { "property" = "programname" }
    { "operation" = "startswith" }
    { "value" = "spice-vdagent" }
    { "action"
      { "file" = "/var/log/spice-vdagent.log" }
      { "template" = "SpiceTmpl" } } }

test Rsyslog.lns get ":msg, !contains, \"error\" /var/log/noterror.log\n" =
  { "filter"
    { "property" = "msg" }
    { "operation" = "!contains" }
    { "value" = "error" }
    { "action"
      { "file" = "/var/log/noterror.log" } } }

Anon7 - 2022
AnonSec Team