Log Hub Events to remote server (syslog)?

I added TCP. For folks who want to try it, my version of this is at GitHub - staylorx/hubitatCode. @User12Hubitat, that change is carried into the existing PR.

Thanks so much! I merged your changes.

@staylorx thank you for you code. I have noticed a number of "warnRead timed out" errors every 10-20 seconds. they usually come in packs of 5-7 at a time. I have tried to debug but it doesn't shed any light on this "warning". do you have any ideas or insight?

@User12Hubitat, I have to again thank you again for your driver code. This is a great code! It is great to have an second repository of where HE can drop logs.

1 Like

Well, the good news is two fold. First I'm learning a lot and second, I see the same timeouts if I use TCP.

Sort of related, @steelz1, what are using as a syslog server?

I'll chisel at it today to see what I can find. I updated the driver just now. Try it and see how it goes. https://raw.githubusercontent.com/staylorx/hubitatCode/master/drivers/Syslog.groovy

If it works I'll put in a PR to bring it back into @User12Hubitat.

1 Like

@staylorx I'm running UDP currently but have tried it TCP as well and I get about double the "warn" messages as UDP. Feel free to keep asking me for input, but just keep in mind i'm terrible at coding (but I am a season tech of 25+ years) but i'm happy to provide whatever info I can to better your and @User12Hubitat code! Feel free to PM me if needed. I should be in front of the screens most of the day today!

Thanks again!

I'll hit you on PM for sure. In the meantime my small fix to code didn't get it. I'll wireshark it and see what I can learn today. It hummed along all yesterday afternoon of course. :slight_smile:

@staylorx yea mine is working, and those "warn" messages are only showing in the HE logs, they aren't replicating to my syslog server, I just noticed that. But yea, feel free to hit me up!! good luck wiresharking!!! lol

I posted up a PR and fix for a couple dumb coding errors. But still no real fix for the TCP side of things. This is my first jump into HE developer programming and I'm struggling to sift through the docs. When I learn more, I'll keep fixing! Small coding fix for UDP selection by staylorx · Pull Request #2 · hubitatuser12/hubitatCode · GitHub

1 Like

no worries!! i'll apply your fix you have to update my driver. again feel free to PM me for information or to use my HE as a test for your code.

Thanks,

@staylorx so i just just applied the drive update you put out. I don't know if you disabled that logging, but i have not seen one error since??? I'm totally at a loss haha!!.. Just thought i'd let you know.

1 Like

This is great! Was just coming back to comment that this is even more important now that events are limited to 100 per device... makes it super hard to troubleshoot if you don't notice right away.

yea.. i'm loving this driver code.. i am able to go back into my Syslog server and pull up practically everything that my C5 did. I just linked my C7 via hubconnect until HE comes out with the migration tools. i was considering having the C7 send to my Syslog as well but i don't think it's necessary as the logs are practically duplicates between the 2 hubs and there's really no reason to double log "logs" lol..

Again my hat is off to @User12Hubitat and @staylorx for the excellent development of this driver!!! it's a lifesaver!!

2 Likes

Boy I hope they can just roll this into the stock config. Maybe hide it in the diagnostic interface so most users don't even see it... but this is going to be a lifesaver. I've had occasional issues with rules not firing, but not realizing until the next day... which is too late to really doubleshoot.

THANK YOU both! @User12Hubitat (that's twice you've helped me in the last week) and @staylorx.

1 Like

for those interested, you can sign up for a free loggly account, then use their forwarder service on a raspberry pi. =) That is, unless you want to run Splunk or the like at home. =)

This is very cool!! Do you have a dedicated thread for this app yet?

Staylorx was nice enough to make the changes to my original version and push those changes to my repo. The dedicated thread is here: [Beta] Push user logs to Syslog server

1 Like

@staze, (and for other folks), I don't have the $$$ for Splunk, but I've had wonderful luck running a Graylog syslog server on containers (on a server in my garage). I will look into the Loggly bits... I hadn't heard that. Thanks!

1 Like

You can use a free version of splunk that gives you 500MB a day, which is MORE than enough for most people. But I'd look at Loggly first, since it's one less thing to host.

I just downloaded and installed the driver.
What do I do to configure and use it?

Can someone post an example. Maybe add the directions to the GitHub repository.

Thanks

Chris

@cbaksa If you have installed the driver, go to your devices and and add a "virtual device". Find the syslog driver and save. From there, you'll have a new device in your devices list with whatever you named it. From there you can add your Syslog server IP, port information, Protocol you're using, and give it a friendly name as this comes in handy when you're digging through your syslog's logs. Click save and it should start reporting. Keeping in mind of any network blocks ie firewalls or routers you may have to traverse..

Hope this quick dirty bit of info helps!!

1 Like