summaryrefslogtreecommitdiffstats
path: root/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2004-11-18 15:44:22 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2004-11-18 15:44:22 +0000
commit68a33eaca9d98428904b87fddc86a90396af3231 (patch)
tree610d1590ad2ef9d376a6744541128807c3057025 /syslogd.c
parent9b85e5147b9016f9a91fe8b716e5f07d8d913ce1 (diff)
downloadrsyslog-68a33eaca9d98428904b87fddc86a90396af3231.tar.gz
rsyslog-68a33eaca9d98428904b87fddc86a90396af3231.tar.xz
rsyslog-68a33eaca9d98428904b87fddc86a90396af3231.zip
SmallGlitchesFixed
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/syslogd.c b/syslogd.c
index e4019199..252974ec 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -1591,7 +1591,6 @@ int MsgSetRawMsg(struct msg *pMsg, char* pszRawMsg)
char *MsgGetProp(struct msg *pMsg, char *pName)
{
char *pRes; /* result pointer */
- char *pBuf;
static char errMsg[] = "##Can't get property - memory allocation failed!##";
assert(pMsg != NULL);
@@ -1605,6 +1604,8 @@ char *MsgGetProp(struct msg *pMsg, char *pName)
pRes = getHOSTNAME(pMsg);
} else if(!strcmp(pName, "syslogtag")) {
pRes = getTAG(pMsg);
+ } else if(!strcmp(pName, "iut")) {
+ pRes = "1"; /* always 1 for syslog messages (a MonitorWare thing;)) */
} else if(!strcmp(pName, "syslogfacility")) {
if(pMsg->pszFacility == NULL) {
/* we use a 12 byte buffer - as of
@@ -1627,9 +1628,7 @@ char *MsgGetProp(struct msg *pMsg, char *pName)
} else if(!strcmp(pName, "timegenerated")) {
if(pMsg->pszRcvdAt3164 == NULL) {
if((pMsg->pszRcvdAt3164 = malloc(16)) == NULL) return errMsg;
-printf("fomrat returns %d\n", formatTimestamp3164(&pMsg->tRcvdAt, pMsg->pszRcvdAt3164, 16)
-);
-printf("Timesamp: '%s'\n", pMsg->pszRcvdAt3164);
+ formatTimestamp3164(&pMsg->tRcvdAt, pMsg->pszRcvdAt3164, 16);
}
pRes = pMsg->pszRcvdAt3164;
} else {
@@ -4086,10 +4085,10 @@ void writeMySQL(register struct filed *f)
printf("in writeMySQL()\n");
snprintf(sql_command, sizeof(sql_command),
- "INSERT INTO SystemEvents (Message, ReceivedAt, DeviceReportedTime,
- Facility, Priority, FromHost, SysLogTag)
- VALUES
- ('%s', '%s', '%s', %d, %d, '%s', '%s')",
+ "INSERT INTO SystemEvents (Message, ReceivedAt, DeviceReportedTime, "
+ "Facility, Priority, FromHost, SysLogTag) "
+ "VALUES "
+ " ('%s', '%s', '%s', %d, %d, '%s', '%s')",
f->f_pMsg->pszMSG, szRcvAtTimestamp, szTimestamp,
f->f_pMsg->iFacility, f->f_pMsg->iSeverity,
f->f_pMsg->pszHOSTNAME, f->f_pMsg->pszTAG);