there is not currently a way to convert the internal text fields to numeric.

David Lang

On Mon, 12 Mar 2018, deoren wrote:

Date: Mon, 12 Mar 2018 11:07:02 -0500
From: deoren <rsyslog-users-lists.adiscon....@whyaskwhy.org>
Reply-To: rsyslog-users <rsyslog@lists.adiscon.com>
To: rsyslog-users <rsyslog@lists.adiscon.com>
Subject: [rsyslog] Can the new option.jsonf="on" template parameter be used to
     generate numeric JSON field entries?

http://www.rsyslog.com/doc/v8-stable/configuration/templates.html#generating-json


Example from the docs:

template(name="outfmt" type="list" option.jsonf="on") {
property(outname="@timestamp" name="timereported" dateFormat="rfc3339" format="jsonf")
        property(outname="host" name="hostname" format="jsonf")
property(outname="severity" name="syslogseverity-text" caseConversion="upper" format="jsonf") property(outname="facility" name="syslogfacility-text" format="jsonf")
        property(outname="syslog-tag" name="syslogtag" format="jsonf")
        property(outname="source" name="app-name" format="jsonf")
        property(outname="message" name="msg" format="jsonf")

}


I wish to generate JSON content, but instead of a text value for the timestamp field timestamp I wish to provide a numeric value instead.

Otherwise my attempts to send messages into Graylog via "GELF" format results in Graylog generating messages like this one:

WARN [GelfCodec] GELF message <PLACEHOLDER> (received from <PLACEHOLDER:35292>) has invalid "timestamp": 1520867955 (type: STRING)

Does this require that the JSON template be "built by hand" as was needed previously?

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to