diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2006-09-27 15:54:07 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2006-09-27 15:54:07 +0000 |
commit | 64dc3591f4cd8a7eab27d689f2b8f5db4eb56517 (patch) | |
tree | a3801defe1f54fb5a0cf86422f4d3cc6d8ab985e /syslogd.c | |
parent | 5d449b79e0f7ba7c3b2f312409bdd94745caa4a4 (diff) | |
download | rsyslog-64dc3591f4cd8a7eab27d689f2b8f5db4eb56517.tar.gz rsyslog-64dc3591f4cd8a7eab27d689f2b8f5db4eb56517.tar.xz rsyslog-64dc3591f4cd8a7eab27d689f2b8f5db4eb56517.zip |
made the field-delimiter inside property replacer (templates) configurable
Diffstat (limited to 'syslogd.c')
-rw-r--r-- | syslogd.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -895,7 +895,6 @@ static void wallmsg(register struct filed *f); static void reapchild(); static const char *cvthname(struct sockaddr_in *f); static void debug_switch(); -static void logerrorInt(char *type, int errCode); static rsRetVal cfline(char *line, register struct filed *f); static int decode(char *name, struct code *codetab); static void sighup_handler(); @@ -3151,17 +3150,20 @@ static char *MsgGetProp(struct msg *pMsg, struct templateEntry *pTpe, int iCurrFld; char *pFld; char *pFldEnd; - /* first, skip to the field in question. For now, a field - * is made up of HT (tab) characters. This should be - * configurable over time. + /* first, skip to the field in question. The field separator + * is always one character and is stored in the template entry. */ iCurrFld = 1; pFld = pRes; while(*pFld && iCurrFld < pTpe->data.field.iToPos) { /* skip fields until the requested field or end of string is found */ - while(*pFld && *pFld != '\t') +dprintf("compare %d != %d: %d (field %d)\n", (unsigned char) *pFld, pTpe->data.field.field_delim, + ((unsigned char) *pFld != pTpe->data.field.field_delim), + pFld +); + while(*pFld && (unsigned char) *pFld != pTpe->data.field.field_delim) ++pFld; /* skip to field terminator */ - if(*pFld == '\t') { + if(*pFld == pTpe->data.field.field_delim) { ++pFld; /* eat it */ ++iCurrFld; } @@ -3173,7 +3175,7 @@ static char *MsgGetProp(struct msg *pMsg, struct templateEntry *pTpe, /* field found, now extract it */ /* first of all, we need to find the end */ pFldEnd = pFld; - while(*pFldEnd && *pFldEnd != '\t') + while(*pFldEnd && *pFldEnd != pTpe->data.field.field_delim) ++pFldEnd; if(*pFldEnd == '\0') --pFldEnd; /* back of to last real char */ @@ -5601,7 +5603,7 @@ void logerrorSz(char *type, char *errMsg) * correctly formatted for it (containing a single %d param). * rgerhards 2005-09-19 */ -static void logerrorInt(char *type, int errCode) +void logerrorInt(char *type, int errCode) { char buf[1024]; |