Replies: 6 comments 18 replies
-
don't use rfc5424 structured data, almost nobody actually does. It's far better
to make the body of the message be JSON.
(active contributer to the rsyslog project)
adding the proper header to the message is a very good idea. Rsyslog has
heuristics to guess that they are missing and generate replacements, but it's
always better to have the right data there to start with.
Although, is it possible that the hostname is outlet-speakers1-3236 in your
example?
David Lang
…On Tue, 1 Feb 2022, Tommi Lätti wrote:
Date: Tue, 01 Feb 2022 01:30:50 -0800
From: Tommi Lätti ***@***.***>
Reply-To: arendst/Tasmota
***@***.***>
To: arendst/Tasmota ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [arendst/Tasmota] Syslog format (Discussion #14689)
I was looking at starting to ingest events via syslog to my fluentd receiver, and after a little bit of back and forth, it initially looks to me that the Syslog messages that tasmota sends don't really conform with the message standard of either RFC3164 or 5424.
`Outlet-Speakers1-3236 ESP-MQT: stat/Outlet-Speakers1/RESULT = {"TelePeriod":60}`
as an example, it's missing timestamp, loglevel etc, and then has JSON in the payload.
Now to be brutally honest, I don't care too much doing a strict syslog, a pure json would also be very very good format and it's nice to ingest structured data.
So basically, what I would like to see is either
a) RFC5424 format with structured data https://datatracker.ietf.org/doc/html/rfc5424#section-6.3
This would make tasmota syslog output actually real syslog compatible
b) just pure json, include hostname and type whatever is not in the json now, in the json blob. Continue using syslog protocol to send the data
|
Beta Was this translation helpful? Give feedback.
-
Agree with sfromis. The way syslog works for years is as shown in the below syslog output:
Worked perfectly. |
Beta Was this translation helpful? Give feedback.
-
On Tue, 1 Feb 2022, sfromis wrote:
It would be illogical not to call it syslog when the data is sent to a syslog server. There also exists other cases where raw format, with only message text, is logged.
The problem with sending raw data with no header is that the syslog server
that's receiving it has to guess as to what the different parts are. Is the
first string the hostname, the programname, or the beginning of the message
text?
I'm not worried about the body of the message, that is not standardized and so
anyone dealing with syslog gets used to parsing it (and the mmnormalize module
in rsyslog makes short work of it, other syslog servers have regex engines that
can get the job done with a bit more cpu)
But it would be good if we could be confident that we are always sending the
hostname, a category name and then the message.
it would be nice to also send the timestamp, but detecting that it's missing and
replacing it with the local time on the server when it was processed is reliable
enough that it's not a big problem.
David Lang
|
Beta Was this translation helpful? Give feedback.
-
I use the syslog server from Synology and it worked for me either quite well. I have no problems with the timestamp nor with the device sending the information. Compared to your first complaint I do not see this problem. |
Beta Was this translation helpful? Give feedback.
-
Just as a reference here...(as i got hit by this). Setting hostnames in tasmota starting with "z" will trigger rsyslog/rsyslog#4598 in rsyslogd. Just to make you aware. |
Beta Was this translation helpful? Give feedback.
-
Fixed in dev branch v13.3.0.1 |
Beta Was this translation helpful? Give feedback.
-
I was looking at starting to ingest events via syslog to my fluentd receiver, and after a little bit of back and forth, it initially looks to me that the Syslog messages that tasmota sends don't really conform with the message standard of either RFC3164 or 5424.
Outlet-Speakers1-3236 ESP-MQT: stat/Outlet-Speakers1/RESULT = {"TelePeriod":60}
as an example, it's missing timestamp, loglevel etc, and then has JSON in the payload.
Now to be brutally honest, I don't care too much doing a strict syslog, a pure json would also be very very good format and it's nice to ingest structured data.
So basically, what I would like to see is either
a) RFC5424 format with structured data https://datatracker.ietf.org/doc/html/rfc5424#section-6.3
This would make tasmota syslog output actually real syslog compatible
b) just pure json, include hostname and type whatever is not in the json now, in the json blob. Continue using syslog protocol to send the data
Beta Was this translation helpful? Give feedback.
All reactions