How to store openhab logs into influxdb

Hi folks,

I’ve installed openHAB, influxdb, kapacitor and Chronograf in containers. I would like to store the logs coming from OH container into a influxdb database, in order to see this metric in Chronograf.

Any suggestion how to do that? I expect to use Telegraf …

Andrea

Hi @ariela,
first off, influxDB is a time-series DB. If you want to store logs, I strongly suggest to install a log-server like Graylog.

My question is;
A) do you want to persist item-values of openHAB (like temperature, …)
B) do you want to persist system-metrics (like CPU, RAM, …)

If A) then you just need the influxdb persistence.
If B) you’re right with your Telegraf approach.

Just let me know, I can help in both cases.

It seems there is a way here:

@csi_oh B :slight_smile: A is already working as expected
I would like to use B to collect docker logs openhab. In order to see it in Chronograf log viewer

Hi there,
have you checked the official Telegraf plugin?

What kind of data exactly are you looking for? The openHAB logs provide no metrics, only events, errors and rule generated custom entries.
I assume you are interested in resource usage information, like CPU, memory, threads, I/O, uptime, etc.? The plugin mentioned by @csi_oh would be a good starting point in that case.

I think this is more the case :slight_smile:

Mmm … maybe there is a better way to use the “log viewer” in Chronograf.

I will investigate something different.

This is what I meant /w Graylog vs. Chronograf.

No offense, but as always here in the forums - people may only help you as good as your will is to share specific information and requirements.

Good luck buddy!

1 Like

maybe you can help me understanding how can I use the log viewer in Chronograf … are you using it?

I don’t use Chronograf’s log viewer, since I only run Chronograf during development for input monitoring.
Also, common logs are perfectly fine for me during testing with “tail -F”-ing :wink: .

So… I had a quick look into Chronograf’s docu where it says that you need to run Telegraph’s syslog input.

RSyslog could be your syslog-server of choice, an installation-guide can be found here.

Now I’m using Telegraf to collect metrics from docker containers (cpu, mem, …) I have an issue with Disk IO data (not able to collect), I’m working on it.

Maybe I need another Telegraf container to collect logs from Rsyslog to influxdb. It seems much more effective. Unfortunately I can’t redirect a single input to a different database with Telegraf, if I well understood

edit: not correct, it seems “namepass” should do the trick …