1<?php
2/*
3	*********************************************************************
4	* LogAnalyzer - http://loganalyzer.adiscon.com
5	* -----------------------------------------------------------------	*
6	* StreamConfig has the capability to create a specific LogStream	*
7	* object depending on a configured LogStream*Config object.			*
8	*																	*
9	* All directives are explained within this file						*
10	*
11	* Copyright (C) 2008-2010 Adiscon GmbH.
12	*
13	* This file is part of LogAnalyzer.
14	*
15	* LogAnalyzer is free software: you can redistribute it and/or modify
16	* it under the terms of the GNU General Public License as published by
17	* the Free Software Foundation, either version 3 of the License, or
18	* (at your option) any later version.
19	*
20	* LogAnalyzer is distributed in the hope that it will be useful,
21	* but WITHOUT ANY WARRANTY; without even the implied warranty of
22	* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23	* GNU General Public License for more details.
24	*
25	* You should have received a copy of the GNU General Public License
26	* along with LogAnalyzer. If not, see <http://www.gnu.org/licenses/>.
27	*
28	* A copy of the GPL can be found in the file "COPYING" in this
29	* distribution.
30	*********************************************************************
31*/
32
33// --- Avoid directly accessing this file!
34if ( !defined('IN_PHPLOGCON') )
35{
36	die('Hacking attempt');
37	exit;
38}
39// ---
40
41class LogStreamConfigMongoDB extends LogStreamConfig {
42	public $DBServer = '127.0.0.1';
43	public $DBPort = 27017;
44	public $DBName = 'syslog';
45	public $DBUser = '';					// Default = No database user!
46	public $DBPassword = '';				// Default = No Password
47	public $DBTableType = 'mongodb';		// Default = Use mongodb layout!
48	public $DBCollection = 'rsyslog';		// Default Tabelname from RSYSLOG
49//	public $DBEnableRowCounting = true;		// Default RowCounting is enabled!
50
51	// Runtime configuration variables
52	public $RecordsPerQuery = 100;			// This will determine how to limit sql statements
53	public $IDsPerQuery = 5000;				// When we query ID's, we read a lot more the datarecords at once!
54	public $SortColumn = SYSLOG_UID;		// Default sorting column
55
56//	public $FileName = '';
57//	public $LineParserType = "syslog"; // Default = Syslog!
58//	public $_lineParser = null;
59
60	public function LogStreamFactory($o)
61	{
62		// An instance is created, then include the logstreamdisk class as well!
63		global $gl_root_path;
64		require_once($gl_root_path . 'classes/logstreammongodb.class.php');
65
66		// return LogStreamDisk instance
67		return new LogStreamMongoDB($o);
68	}
69}
70?>