PhpLogCon Mysql Configuration Examples

From rsyslog wiki
Jump to: navigation, search

PhpLogCon should automatically do this for you with the setup. However, if you would like to do this on your own(or add a second source in manually), here is an example of a 'working'(some modifcations needed) configuration:

$CFG['Sources']['Source2']['ID'] = 'Source2';
$CFG['Sources']['Source2']['Name'] = 'My Database Source';
$CFG['Sources']['Source2']['ViewID'] = 'SYSLOG';
$CFG['Sources']['Source2']['SourceType'] = SOURCE_DB;
$CFG['Sources']['Source2']['DBTableType'] = 'monitorware';
$CFG['Sources']['Source2']['DBType'] = DB_MYSQL;
$CFG['Sources']['Source2']['DBServer'] = 'localhost';
$CFG['Sources']['Source2']['DBName'] = 'Syslog'; - what you called your database
$CFG['Sources']['Source2']['DBUser'] = 'YourDBUserHere';
$CFG['Sources']['Source2']['DBPassword'] = 'YourDBPasswordHere';
$CFG['Sources']['Source2']['DBTableName'] = 'SystemEvents';
$CFG['Sources']['Source2']['DBEnableRowCounting'] = false;

if you would like to add a text source in, here is a working example of how to do so:

$CFG['Sources']['Source1']['ID'] = 'Source1';
$CFG['Sources']['Source1']['Name'] = 'My Syslog Source';
$CFG['Sources']['Source1']['ViewID'] = 'SYSLOG';
$CFG['Sources']['Source1']['SourceType'] = SOURCE_DISK;
$CFG['Sources']['Source1']['LogLineType'] = 'syslog';
$CFG['Sources']['Source1']['DiskFile'] = '/var/log/syslog';

Personal tools