summaryrefslogtreecommitdiffstats
path: root/tools/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-01-17 10:48:39 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2012-01-17 10:48:39 +0100
commit37e4aab1ecc63db2b5e72fd8a5df5e4976ae82c8 (patch)
tree9db8aec809487aebf97889b801bfeb0c477e824c /tools/syslogd.c
parent76c4d6b951453078ab53bf612caf0b8ec9d54bb8 (diff)
parent9911dacf59e898bae2c8c6619b85348bf54ddc23 (diff)
downloadrsyslog-37e4aab1ecc63db2b5e72fd8a5df5e4976ae82c8.tar.gz
rsyslog-37e4aab1ecc63db2b5e72fd8a5df5e4976ae82c8.tar.xz
rsyslog-37e4aab1ecc63db2b5e72fd8a5df5e4976ae82c8.zip
Merge branch 'v5-stable-elasticsearch' into v5-devel-tmp
Conflicts: ChangeLog configure.ac doc/manual.html tools/syslogd.c
Diffstat (limited to 'tools/syslogd.c')
-rw-r--r--tools/syslogd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 65770404..9553ad08 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -335,6 +335,7 @@ static uchar template_StdUsrMsgFmt[] = "\" %syslogtag%%msg%\n\r\"";
static uchar template_StdDBFmt[] = "\"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%, '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, '%syslogtag%')\",SQL";
static uchar template_StdPgSQLFmt[] = "\"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%, '%timereported:::date-pgsql%', '%timegenerated:::date-pgsql%', %iut%, '%syslogtag%')\",STDSQL";
static uchar template_SysklogdFileFormat[] = "\"%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%\n\"";
+static uchar template_StdJSONFmt[] = "\"{\\\"message\\\":\\\"%msg%\\\",\\\"fromhost\\\":\\\"%HOSTNAME%\\\",\\\"facility\\\":\\\"%syslogfacility-text%\\\",\\\"priority\\\":\\\"%syslogpriority-text%\\\",\\\"timereported\\\":\\\"%timereported:::date-rfc3339%\\\",\\\"timegenerated\\\":\\\"%timegenerated:::date-rfc3339%\\\"}\",JSON";
static uchar template_spoofadr[] = "\"%fromhost-ip%\"";
/* end templates */
@@ -2183,6 +2184,8 @@ static rsRetVal mainThread()
tplAddLine("RSYSLOG_SysklogdFileFormat", &pTmp);
pTmp = template_StdPgSQLFmt;
tplAddLine(" StdPgSQLFmt", &pTmp);
+ pTmp = template_StdJSONFmt;
+ tplAddLine(" StdJSONFmt", &pTmp);
pTmp = template_spoofadr;
tplLastStaticInit(tplAddLine("RSYSLOG_omudpspoofDfltSourceTpl", &pTmp));