is it possible to write logs (in the syslog format) straight into the database? Like writing a new point into the database? I have tested so far with the InfluxData API and was able to write information into the database
but not logs.
I haven’t found any information on this and I wonder if there is a possibility without using telegraf.
I’m not sure I entirely understand what it is that you want to do. You could convert your logs to line protocol and then you could write data from the txt file that contains your logs in line protocol as described here. Does this help at all? Why don’t you want to use the syslog telegraf input?
It is possible to write logs straight into the database for use with the Chronograf log viewer.
Normally Telegraf is responsible for accepting messages in syslog format and converting them to line protocol to be written to InfluxDB. It inserts all syslog messages into a measurement called syslog, which is what Chronograf looks for when it is populating the log viewer with data. The viewer has drop-down menus at the upper right for selecting the InfluxDB instance and database to use.
The schema looks like this:
Tags:
appname
facility
host
hostname
severity (needs to match the syslog severity levelkeyword to display properly in Chronograf)
You can get more information on things like severity codes and facilities on the syslog Wikipedia page.
You can also use this schema with the Telegraf tail plugin and the grok parser to read logs into InfluxDB from log files without using syslog. We’re working on a blog post that covers this use case in more detail.
The time range in your log viewer is set to now with a -1m range; looks like your logs might be outside that time range.
Another thing to keep in mind is that Chronograf uses the timestamp field to visualize the logs. This is the time that the log was written, as opposed to the internal InfluxDB timestamp for the measurement, which indicates when the log was received. The time the log was written is more valuable for diagnostic purposes and correlation with other metrics and logs.
Here you can see that although I changed the range it is not showing my logs.
The one green column is from logs that rsyslog sent over telegraf.
I had sent some logs over rsyslog to see which timestamp InfluxDB is using to store syslogs.