本文整理汇总了PHP中conv_log_filter函数的典型用法代码示例。如果您正苦于以下问题:PHP conv_log_filter函数的具体用法?PHP conv_log_filter怎么用?PHP conv_log_filter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了conv_log_filter函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gettext
$view_title = gettext("Dynamic View");
}
if ($view == 'summary') {
$view_title = gettext("Summary View");
}
// Status Logs Common - Code
status_logs_common_code();
$pgtitle = array(gettext("Status"), gettext("System logs"), gettext($allowed_logs[$logfile]["name"]), $view_title);
include "head.inc";
if (!$input_errors && $savemsg) {
print_info_box($savemsg, 'success');
$manage_log_active = false;
}
// Tab Array
tab_array_logs_common();
$filterlog = conv_log_filter($logfile_path, $lines, $lines);
$gotlines = count($filterlog);
$fields = array('act' => gettext("Actions"), 'interface' => gettext("Interfaces"), 'proto' => gettext("Protocols"), 'srcip' => gettext("Source IPs"), 'dstip' => gettext("Destination IPs"), 'srcport' => gettext("Source Ports"), 'dstport' => gettext("Destination Ports"));
$segcolors = array("#2484c1", "#65a620", "#7b6888", "#a05d56", "#961a1a", "#d8d23a", "#e98125", "#d0743c", "#635222", "#6ada6a");
$numcolors = 10;
$summary = array();
foreach (array_keys($fields) as $f) {
$summary[$f] = array();
}
$totals = array();
foreach ($filterlog as $fe) {
$specialfields = array('srcport', 'dstport');
foreach (array_keys($fields) as $field) {
if (!in_array($field, $specialfields)) {
$summary[$field][$fe[$field]]++;
}
示例2: TORT
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
$pgtitle = array(gettext('Firewall'), gettext('Log Files'), gettext('Summary View'));
$shortcut_section = "firewall";
require_once "guiconfig.inc";
require_once "filter_log.inc";
require_once "interfaces.inc";
$filter_logfile = '/var/log/filter.log';
$lines = 5000;
// Maximum number of log entries to fetch
$entriesperblock = 10;
// Maximum elements to show individually
// Retrieve filter log data
$filterlog = conv_log_filter($filter_logfile, $lines, $lines);
// Set total retrieved line counter
$gotlines = count($filterlog);
// Set readable fieldnames
$fields = array('act' => gettext("Actions"), 'interface' => gettext("Interfaces"), 'proto' => gettext("Protocols"), 'srcip' => gettext("Source IPs"), 'dstip' => gettext("Destination IPs"), 'srcport' => gettext("Source Ports"), 'dstport' => gettext("Destination Ports"));
$summary = array();
foreach (array_keys($fields) as $f) {
$summary[$f] = array();
}
// Fill summary array with filterlog data
foreach ($filterlog as $fe) {
foreach (array_keys($fields) as $field) {
if (isset($fe[$field])) {
if (!isset($summary[$field])) {
$summary[$field] = array();
}
示例3: get_configured_interface_with_descr
<div class="tab-content content-box col-xs-12">
<div class="table-responsive">
<table class="table table-striped table-sort">
<?php
$iflist = get_configured_interface_with_descr(false, true);
if (isset($iflist[$interfacefilter])) {
$interfacefilter = $iflist[$interfacefilter];
}
if (isset($filtersubmit)) {
$filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100, $filterfieldsarray);
} else {
$filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100, $filtertext, $interfacefilter);
}
?>
<tr>
<td colspan="<?php
echo isset($config['syslog']['filterdescriptions']) && $config['syslog']['filterdescriptions'] === "1" ? 7 : 6;
?>
" class="listtopic">
<strong>
<?php
if (!$filtertext && !$filterfieldsarray) {
printf(gettext("Last %s firewall log entries."), count($filterlog));
} else {
echo sprintf(gettext('Showing %s matching log entries (maximum is %s).'), count($filterlog), $nentries);
}
?>
示例4: handle_ajax
##|*IDENT=page-hidden-nolongerincluded
##|*NAME=Hidden: No longer included page
##|*DESCR=Allow access to the 'Hidden: No longer included' page.
##|*MATCH=diag_logs_filter_dynamic.php*
##|-PRIV
require "guiconfig.inc";
require_once "filter_log.inc";
$filter_logfile = "{$g['varlog_path']}/filter.log";
/* Hardcode this. AJAX doesn't do so well with large numbers */
$nentries = 50;
/* AJAX related routines */
handle_ajax($nentries, $nentries + 20);
if ($_POST['clear']) {
clear_log_file($filter_logfile);
}
$filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100);
$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Firewall (Dynamic View)"));
$shortcut_section = "firewall";
include "head.inc";
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php
include "fbegin.inc";
?>
<script type="text/javascript">
//<![CDATA[
lastsawtime = '<?php
echo time();
?>
;';
var lines = Array();
示例5: isset
$nentries = isset($config['widgets']['filterlogentries']) ? $config['widgets']['filterlogentries'] : 5;
//set variables for log
$nentriesacts = isset($config['widgets']['filterlogentriesacts']) ? $config['widgets']['filterlogentriesacts'] : 'All';
$nentriesinterfaces = isset($config['widgets']['filterlogentriesinterfaces']) ? $config['widgets']['filterlogentriesinterfaces'] : 'All';
$filterfieldsarray = array("act" => $nentriesacts, "interface" => $nentriesinterfaces);
$filter_logfile = "{$g['varlog_path']}/filter.log";
/* AJAX related routines */
if (isset($_POST['lastsawtime'])) {
$filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 20);
foreach ($filterlog as $idx => $row) {
if (strtotime($log_row['time']) <= $_POST['lastsawtime']) {
unset($filterlog[$idx]);
}
}
} else {
$filterlog = conv_log_filter($filter_logfile, $nentries, 50, $filterfieldsarray);
}
?>
<script type="text/javascript">
//<![CDATA[
var logWidgetLastRefresh = <?php
echo time();
?>
;
//]]>
</script>
<table class="table table-striped table-hover">
<thead>
<tr>
示例6: Form_Input
$group->add(new Form_Input('filtertext', null, 'text', $filtertext))->setWidth(6)->setHelp('Filter Expression');
$group->add(new Form_Input('filterlogentries_qty', null, 'number', $filterlogentries_qty, ['placeholder' => $nentries]))->setWidth(2)->setHelp('Quantity');
$btnsubmit = new Form_Button('filtersubmit', ' ' . gettext('Apply Filter'), null, 'fa-filter');
}
$btnsubmit->removeClass('btn-primary')->addClass('btn-success')->addClass('btn-sm');
$group->add(new Form_StaticText('', $btnsubmit));
$group->setHelp('<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">' . gettext('Regular expression reference') . '</a> ' . gettext('Precede with exclamation (!) to exclude match.'));
$section->add($group);
$form->add($section);
print $form;
// Now the forms are complete we can draw the log table and its controls
if (!$rawfilter) {
if ($filterlogentries_submit) {
$filterlog = conv_log_filter($system_logfile, $nentries, $nentries + 100, $filterfieldsarray);
} else {
$filterlog = conv_log_filter($system_logfile, $nentries, $nentries + 100, $filtertext);
}
?>
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">
<?php
if (!$filtertext && !$filterfieldsarray) {
printf(gettext("Last %d %s log entries."), count($filterlog), gettext($allowed_logs[$logfile]["name"]));
} else {
printf(gettext("%d matched %s log entries."), count($filterlog), gettext($allowed_logs[$logfile]["name"]));
}
printf(" (" . gettext("Maximum %d") . ")", $nentries);
?>
</h2>
示例7: array
$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("VPN"), gettext($allowed_logs[$logfile]["name"]));
include "head.inc";
if (!$input_errors && $savemsg) {
print_info_box($savemsg, 'success');
$manage_log_active = false;
}
// Tab Array
tab_array_logs_common();
// Filter Section/Form - VPN
filter_form_vpn();
// Now the forms are complete we can draw the log table and its controls
if (!$rawfilter) {
if ($filterlogentries_submit) {
$filterlog = conv_log_filter($logfile_path, $nentries, $nentries + 100, $filterfieldsarray);
} else {
$filterlog = conv_log_filter($logfile_path, $nentries, $nentries + 100, $filtertext);
}
// Remove those not of the selected vpn type (poes / l2tp).
if ($logfile == "vpn") {
foreach ($filterlog as $key => $filterent) {
if (!preg_match('/' . $vpntype . '/', $filterent['type'])) {
unset($filterlog[$key]);
}
}
}
?>
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">
<?php
示例8: write_config
write_config("Saved Filter Log Entries via Dashboard");
$filename = $_SERVER['HTTP_REFERER'];
if (headers_sent($file, $line)) {
echo '<script type="text/javascript">';
echo 'window.location.href="' . $filename . '";';
echo '</script>';
echo '<noscript>';
echo '<meta http-equiv="refresh" content="0;url=' . $filename . '" />';
echo '</noscript>';
}
Header("Location: /");
}
$nentries = isset($config['widgets']['filterlogentries']) ? $config['widgets']['filterlogentries'] : 5;
//set variables for log
$filter_logfile = "{$g['varlog_path']}/filter.log";
$filterlog = conv_log_filter($filter_logfile, $nentries);
/* AJAX related routines */
handle_ajax($nentries, $nentries + 20);
?>
<script language="javascript">
lastsawtime = '<?php
echo time();
?>
';
var lines = Array();
var timer;
var updateDelay = 30000;
var isBusy = false;
var isPaused = false;
var nentries = <?php