Any tips on sending OpenWRT system logs to Grafana Loki?

Does anyone have any tips on sending OpenWRT system logs to Grafana Loki?

Looking through the software packages for OpenWRT there doesn't appear to be a promtail package.

I know that I can set up network logging so my logs are forwarded to a syslog server, but is that the best course of action? I'm thinking of running a syslog server in a docker container that will then forward the logs to Grafana Loki, but I want to make sure that I'm not taking any unnecessary steps if there is a cleaner set up.

Thanks!

You need some syslog forwarder on grafana host to post standard syslog protocol from network into grafana api.

1 Like

I’m having the same issue but I don’t understand your comment.

I have my OpenWrt router to send the logs to my Grafana/Loki/Promtail/etc.. server (IP: 192.168.1.6) and locally to /tmp and on my promtail config file I have configured it in this way:


 job_name: 'r4s'
  static_configs:
  - targets:
      - '192.168.1.2'  # IP of my OpenWrt router
    labels:
      job: openwrt
      __path__: /tmp/*.log  

I see all the other logs from my other servers but not from OpenWrt router.

What I’m doing wrong?

Asking for grafana support in openwrt forums is wrong.
Openwrt forwards syslog, you need grafanas instructions on how grafana supports that.

But Grafana and other servers are sending logs and working fine. It’s only the OpenWrt router that is not sending data to Promtail.

This is why I asked here.

Sorry you need to ask advertised function at your vendors support booth:

…your link is for Telegraf and InfluxDB, not Loki and Promtail.

Anyway I’ll to ask in the Grafana forum but I suspect they will respond that “if other logs work, than is an OpenWrt issue” :slight_smile:

Anyway here is my OpenWrt setting if this can help others…


config system
        option ttylogin '0'
        option log_size '64'
        option urandom_seed '0'
        option log_proto 'udp'
        option conloglevel '8'
        option cronloglevel '5'
        option hostname 'R4S'
        option zonename 'Europe/Rome'
        option timezone 'CET-1CEST,M3.5.0,M10.5.0/3'
        option log_ip '192.168.1.6'
        option log_file '/tmp/system.log'

You are demanding to edit excel tables with photoshop.

Promtail should convert the OpenWrt logs for Loki, this is a communication issue with OpenWrt and Promtail.

Probably I’ve configured something wrong, I’ve done all fast yesterday evening without checking it again. I’ll try again at home.

Nothing moves until you get official statement from grafana they do not support syslog protocol.

Ok, I got it working. The issue wasn't with either OpenWrt or Grafana but with the OS on my server. Since I'm using DietPI, I forgot that by default it doesn't have rsyslog installed, because it keeps the logs in RAM to avoid microSD wear

I installed it, configured it and now I can perfectly see my OpenWrt logs from Grafana via Loki :ok_hand:

But thanks for pointing out the phrase 'syslog protocol ', it made me doubt about the presence of rsyslog on my Grafana machine :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.