Preferably also some settings like, what kind of logs do you want to send
It might be alot if you want to send every single log event and maybe you are only interrested in the administrative logs.
And of course, if you send logs, and you change theese settings, thats also a log entry that should be sent.
Need access to rsyslog or a way to send logs to a syslog server. I would like to use graylog for advanced troubleshooting.
I know this isn’t the same as full remote syslog, but I found a way to send notifications into syslog via netcat.
notify:
- name: syslog
platform: command_line
command: "nc 10.10.10.10 -u 514 -w 1"
service: notify.syslog
data:
message: <14>this is a test
I would also love this function. Much better to get alerts when something is wrong in HA.
Although it probably doesn’t cover all use-cases mentioned above, I just want to let you know that I created a Logspout add-on some time ago which can be used to send the container logs to rsyslog or some other log management system.
its kind of crazy that this is not a thing. i use splunk for monitoring and the thing that needs the most monitoring … cant.
Did you find a way to get your logs to Splunk somehow? I did find some adapters for Logspout so I might be able to add support to the Logspout Addon.
I think its also possible to use the syslog or GELF adapter for Splunk though which is already supported by the Logspoud addon.
I am sitting here ready to write a splunk add on for HA. Now I am sad.
I found this as a surprise, that Home Assistant Operating System does not support remote syslog
Now I’m thinking of migration to some other installation method, so I can access the raw logs…
Thanks! That’s very helpful. I’m running HA on a Synology and netcat is not available but socat is via the SynoCli Network Tools package. It can work the same way:
notify:
- name: syslog
platform: command_line
command: "socat - UDP:192.168.1.100:514"
This works great, thanks!
The format of command_line notify has shifted to be under the command_line hierarchy. This is what my example looks like now:
command_line:
- notify:
name: syslog
command: "nc 10.10.10.10 -u 514 -w 1"
Just here to upvote this and share our requirements and use case
We need to send logs via syslog to a specified remote server with a configurable destination IP, Port, and ideally, protocol (UDP/TCP). Syslog Facility and Severity parameters should be supported.
I’m in a business context in the IT department and we want to use Home Assistant and Konnected to create entry alarms which leverage installed sensors. The business policy requires that everything log to our remote centralized seim so we can coordinate physical and digital events.
We’d like to send both OS events (ssh login successful, etc) and Home Assistant logbook events (motion detected, light turned off) to the remote syslog.
Thanks very much.
I would like to be able to add my logs to rsyslog server as well. Hope we can get this feature anytime soon.
Hi,
maybe my new GitHub - mib1185/ha-addon-syslog: Syslog Home Assistant AddOn - to send your HAOS logs to a remote syslog server might be helpful to export HA-OS logs to a remote syslog server.
Thanks! Installed and testing.
Thank you! This worked instantly. Now i’m seeing HA logging to my remote syslog-ng.
Michael: Thank You!
This sounds great, installing now. One question for my and others’ info - will it log both traditional linux-y syslogs from the OS and also home assistant logbook events (like motion detected, light turned on, etc)???
Installed and working perfectly, so I’m answering my own question
This only sends system logs (Settings ->Logs) such as Core / Supervisor / Host / DNS etc to the remote syslog
If you also want to log events within Home Assistant like motion detected, etc (things from (Logbook) on the main navigation panel) I recommend remote_syslog by thebytestuff (GitHub - TheByteStuff/RemoteSyslog_Service: Home Assistant Custom Component - send Syslog message to remote server.) available in HACS as a custom repo. It makes a service available that you can call in automations to log home assistant logbook events. This means you have to write automations for things you want to log, but that seems reasonable to me.
The syslog add on here and remote_syslog seem to play nicely together, I’m running both.
Many thanks mib1185 and TheByteStuff!!!
Still working good. Thanks to all participated in the development. Cheers