SmartThings Community

Best way to collect logs from the hub?


(Rlyons20) #124

FYI, i just put the lock section back to generichandler in my app, and it’s working. I don’t know why…


(BoruGee) #125

My setup work without ssl. Can someone explain how to get splunk working with ssl? How/Where to get a certificate, does the certificate need to be installed on Smartthings? or Splunk? or both?

Thank you…


(Moose Quest) #126

Are you using Splunk Cloud or installed locally?


(BoruGee) #127

Splunk locally. (Not splunk Cloud)


(Jason Hamilton) #128

Just curious what your reasons are for encrypting the traffic between the hub and your local splunk instance?


(BoruGee) #129
  1. Curious how to use ssl
  2. Just think that using encryption would be secure, so no one in the middle can detect what is happenning in my home.

(Jason Hamilton) #130

Who’s in the middle in your home?

I would try and get a ssl from letsencrypt and see if that works.


(BoruGee) #131

I did not mean anyone in the middle of my house :joy: What I meant is, when Smartthings servers send data to my splunk server at home, someone in the middle in the network path (Ex ISP) can get to that data if not encrypted. Mostly I am interested in learning how to do this than security aspect of this at this point. However I have no clue, if I need to install the certificate in ST, Splunk or both?

From all the questions that you guys are asking look like this is a complicated setup, and may be I will give up.

Thank you for the help.


(Jason Hamilton) #132

@Boruguru so actually the hub is sending the logs to your splunk server. Anything that is traveling over the wire between ST and you is already there we’re just going to send it to your splunk server from your hub directly. I also do believe that all communications between your hub and ST is already encrypted to prevent the 3rd party from snooping in and more importantly hacking your devices. Don’t give up I didn’t mean to sound brash it comes with being and engineer. Let us know what we can do to help get you setup and splunking your ST data.


(Moose Quest) #133

If the server is local, and you are communicating inbound from the
SmartThings Inbound. Yes SSL is nice. However I’m not sure the current JSON
API works with it. Are you stuck or looking for direction? The reason for
the question is because I’m asking if you know whether SSL is supported for
this; two if so, are you stuck.


(Anders) #134

I’m using Splunk on a Digital Ocean server, and thus sending info over the internet. If you’re looking at a similar situation I got everything working with certificate from LetsEncrypt! and with Apache as a terminating proxy for Splunk. Don’t ask me about the details, cause it was a bit of a hassle, but it’s working. Some times it helps to know it’s doable. :wink:


(Jason Hamilton) #135

I have done the apache reverse proxy several times. I can assist with this setup if this is what you’re looking for.


(BoruGee) #136

My situation is also, I am getting my data to my splunk server over internet, and hence thought encryption is good to be enabled. However looks bit complicated to setup. So I will add it for future to do list. Thank you for the help and all the input.


(Moose Quest) #137

Yeah you could do SSL Termination with HAProxy but still need certs.


(Anders) #138

Look at Lets Encrypt. Free SSL certs that works with most browsers. It’s insanely awesome. :wink:


(Moose Quest) #139

Let’s Encrypt will work for this. But this is from the SmartThings IDE
environment or cloud if you will to Splunk HEC. No browser, but shouldn’t
matter.


(Jason Hamilton) #140

So does anyone who is doing the splunk with a energy meter such as the Aeon one, know how to calculate daily total kWh usage? The thing reports the current usage such as 1800 Watts or what not but obiviously if I took that and totaled it up when it reports in every 30 seconds my daily usage would be ridiculous. Thanks.


(Mike) #141

I do it by calculating the instantaneous KWH usage amount for each reading and adding it up over each 24 hour period.

(Instantaneous Power/1000)/(samples per hour)

I am logging to Thingspeak. It tracks almost exactly with the readings my Power company comes up with.


(Moose Quest) #142

I’m at OpenStack Boston – Soon as I get back to a terminal I will check
what I’m using. But I’m pretty sure capturing instantaneous and then taking
a eval command over time.


(BoruGee) #143

I used to be able to log through localserver option using a localnetwork until 2 weeks ago. Not anymore. Anyone else having same issue. May be issue on my localnetwork. Not sure, just checking with others who use splunk / smartthings. Thank you.