[Netflow live] Removed aggregate by protocol

Former-commit-id: 2f02a384966bc4200f8b9b294e02fbd90ab440ef
This commit is contained in:
fermin831 2019-03-18 15:44:23 +01:00
parent 4f8c7daada
commit 80c79b532b
2 changed files with 14 additions and 30 deletions

View File

@ -503,19 +503,11 @@ function netflow_get_data(
}
$val = explode(',', $line);
if ($aggregate == 'proto') {
$values['sources'][$val[3]] = 1;
} else {
$values['sources'][$val[4]] = 1;
}
$values['sources'][$val[4]] = 1;
}
// Update the filter.
switch ($aggregate) {
case 'proto':
$extra_filter = 'proto';
break;
default:
case 'srcip':
$extra_filter = 'ip_src';
@ -699,28 +691,24 @@ function netflow_get_stats(
$datetime = $val[0];
$end_date = strtotime($datetime);
$values[$i]['datetime'] = $end_date;
if ($aggregate == 'proto') {
$values[$i]['agg'] = $val[3];
} else {
// Address resolution start.
if ($address_resolution && ($aggregate == 'srcip' || $aggregate == 'dstip')) {
global $hostnames;
// Address resolution start.
if ($address_resolution && ($aggregate == 'srcip' || $aggregate == 'dstip')) {
global $hostnames;
if (!isset($hostnames[$val[4]])) {
$hostname = gethostbyaddr($val[4]);
if ($hostname !== false) {
$hostnames[$val[4]] = $hostname;
$val[4] = $hostname;
}
} else {
$val[4] = $hostnames[$val[4]];
if (!isset($hostnames[$val[4]])) {
$hostname = gethostbyaddr($val[4]);
if ($hostname !== false) {
$hostnames[$val[4]] = $hostname;
$val[4] = $hostname;
}
} else {
$val[4] = $hostnames[$val[4]];
}
// Address resolution end.
$values[$i]['agg'] = $val[4];
}
// Address resolution end.
$values[$i]['agg'] = $val[4];
if (! isset($val[9])) {
return [];
}
@ -1534,9 +1522,6 @@ function netflow_format_aggregate($aggregate)
case 'dstip':
return __('Dst IP');
case 'proto':
return __('Protocol');
case 'srcip':
return __('Src IP');

View File

@ -336,7 +336,6 @@ if (is_metaconsole()) {
echo '<td><b>'.__('Aggregate by').'</b>'.ui_print_help_icon('aggregate_by', true).'</td>';
$aggregate_list = [];
$aggregate_list = [
'proto' => __('Protocol'),
'srcip' => __('Src Ip Address'),
'dstip' => __('Dst Ip Address'),
'srcport' => __('Src Port'),