Added special handling for the date fields

This commit is contained in:
unknown 2008-09-11 16:29:11 +02:00
parent 24cd80089b
commit efc27aed5f
4 changed files with 31 additions and 4 deletions

View File

@ -75,7 +75,7 @@ if ( isset($_GET['byfield']) )
if ( isset($fields[ $_GET['byfield'] ]) )
{
$content['chart_field'] = $_GET['byfield'];
$content['chart_fieldtype'] = $fields[SYSLOG_UID]['FieldType'];
$content['chart_fieldtype'] = $fields[ $content['chart_field'] ]['FieldType'];
}
else
{

View File

@ -598,13 +598,22 @@ class LogStreamDisk extends LogStream {
{
if ( isset($logArray[$szFieldId]) )
{
if ( isset($aResult[ $logArray[$szFieldId] ]) )
$aResult[ $logArray[$szFieldId] ]++;
if ( $nFieldType == FILTER_TYPE_DATE )
{
// Convert to FULL Day Date for now!
$myFieldData = date( "Y-m-d", $logArray[$szFieldId][EVTIME_TIMESTAMP] );
}
else // Just copy the value!
$myFieldData = $logArray[$szFieldId];
if ( isset($aResult[ $myFieldData ]) )
$aResult[ $myFieldData ]++;
else
{
// Initialize entry if we haven't exceeded the RecordLImit yet!
if ( count($aResult) < ($nRecordLimit-1) ) // -1 because the last entry will become all others
$aResult[ $logArray[$szFieldId] ] = 1;
$aResult[ $myFieldData ] = 1;
else
{
// Count record to others

View File

@ -289,5 +289,14 @@ $content['LN_DETAIL_BACKTOLIST'] = "Back to Listview";
$content['LN_GEN_ERROR_MISSINGCHARTFIELD'] = "Missing fieldname";
$content['LN_GEN_ERROR_INVALIDTYPE'] = "Invalid or unknown chart type";
$content['LN_ERROR_CHARTS_NOTCONFIGURED'] = "There are no charts configured at all.";
$content['LN_CHART_TYPE'] = "Chart type";
$content['LN_CHART_WIDTH'] = "Chart width";
$content['LN_CHART_FIELD'] = "Chart field";
$content['LN_CHART_MAXRECORDS'] = "Top records count";
$content['LN_CHART_SHOWPERCENT'] = "Show percentage data";
$content['LN_CHART_TYPE_CAKE'] = "Cake (Pie)";
$content['LN_CHART_TYPE_BARS_VERTICAL'] = "Bars vertical";
$content['LN_CHART_TYPE_BARS_HORIZONTAL'] = "Bars horizontal";
$content['LN_STATS_WARNINGDISPLAY'] = "Generating graphics on large data sources currently is very time consuming. This will be addressed in later versions. If processing takes too long, please simply cancel the request.";
?>

View File

@ -294,5 +294,14 @@ $content['LN_DETAIL_BACKTOLIST'] = "Voltar para a lista";
$content['LN_GEN_ERROR_MISSINGCHARTFIELD'] = "Missing fieldname";
$content['LN_GEN_ERROR_INVALIDTYPE'] = "Invalid or unknown chart type";
$content['LN_ERROR_CHARTS_NOTCONFIGURED'] = "There are no charts configured at all.";
$content['LN_CHART_TYPE'] = "Chart type";
$content['LN_CHART_WIDTH'] = "Chart width";
$content['LN_CHART_FIELD'] = "Chart field";
$content['LN_CHART_MAXRECORDS'] = "Top records count";
$content['LN_CHART_SHOWPERCENT'] = "Show percentage data";
$content['LN_CHART_TYPE_CAKE'] = "Cake (Pie)";
$content['LN_CHART_TYPE_BARS_VERTICAL'] = "Bars vertical";
$content['LN_CHART_TYPE_BARS_HORIZONTAL'] = "Bars horizontal";
$content['LN_STATS_WARNINGDISPLAY'] = "Generating graphics on large data sources currently is very time consuming. This will be addressed in later versions. If processing takes too long, please simply cancel the request.";
?>