Suppress logging of beacons

Hi all,

Any idea how to suppress all the BEACON notices in the log? I know you can change the log level in /etc/config/wireless but then I miss other other stuff (which is useful sometimes).

Thanks,

Ramon

Tue Sep 21 20:01:29 2021 daemon.notice hostapd: wlan0: BEACON-REQ-TX-STATUS xx:xx:xx:xx:xx:xx aa ack=1
Tue Sep 21 20:01:29 2021 daemon.notice hostapd: wlan0: BEACON-RESP-RX xx:xx:xx:xx:xx:xx 58 04
Tue Sep 21 20:01:50 2021 daemon.notice hostapd: wlan0: BEACON-REQ-TX-STATUS xx:xx:xx:xx:xx:xx ack=0
Tue Sep 21 20:02:09 2021 daemon.notice hostapd: wlan0: BEACON-REQ-TX-STATUS xx:xx:xx:xx:xx:xx 60 ack=1
Tue Sep 21 20:02:09 2021 daemon.notice hostapd: wlan0: BEACON-RESP-RX xx:xx:xx:xx:xx:xx 60 04
Tue Sep 21 20:02:31 2021 daemon.notice hostapd: wlan0: BEACON-REQ-TX-STATUS xx:xx:xx:xx:xx:xx 61 ack=1

hi,

i could not figure out either the right hostapd config to reduce noise so rather installed syslog-ng and created a simple filter:

filter f_beacon {
        not( program("hostapd") and message("BEACON-*") );
};

thanks for the suggestion but i get this error when installing:

Collected errors:
 * check_data_file_clashes: Package syslog-ng wants to install file /sbin/logread
	But that file is already provided by package  * logd
 * opkg_install_cmd: Cannot install package syslog-ng.

Any idea?

that's normal.

### step 1.
### this is the factory default logging service
# opkg list-installed | grep log
logd - 2020-10-25-9ef88681-2

### step 2.
### you have to replace it with syslog-ng
### stop existing logging service
# service log stop
# opkg remove logd && opkg install syslog-ng

### step 3.
###  in /etc/syslog-ng.conf change this section to include the filter above

### add this
filter f_beacon {
        not( program("hostapd") and message("BEACON-*") );
};


log {
        source(src);
        source(net);
        source(kernel);
        filter(f_beacon); ### <--- add this
        destination(messages);

        # uncomment this line to open port 514 to receive messages
        #source(s_network);
};

### step 4.
### then restart the new syslog-ng service
# service syslog-ng enable && service syslog-ng restart

### step 5.
### read admin guide https://www.syslog-ng.com/technical-documents/doc/syslog-ng-open-source-edition/3.33/administration-guide

That seems to work, thanks!

Two things though:

  1. I get a bit strange "command failed: Not found". But it seems to work anyway...
root@OpenWrt:~# opkg install syslog-ng
Installing syslog-ng (3.33.2-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a15_neon-vfpv4/packages/syslog-ng_3.33.2-1_arm_cortex-a15_neon-vfpv4.ipk
Installing libffi (3.3-2) to root...
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a15_neon-vfpv4/packages/libffi_3.3-2_arm_cortex-a15_neon-vfpv4.ipk
Installing glib2 (2.66.4-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a15_neon-vfpv4/packages/glib2_2.66.4-1_arm_cortex-a15_neon-vfpv4.ipk
Installing libdbi (0.9.0-5) to root...
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a15_neon-vfpv4/packages/libdbi_0.9.0-5_arm_cortex-a15_neon-vfpv4.ipk
Installing libnghttp2-14 (1.43.0-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a15_neon-vfpv4/packages/libnghttp2-14_1.43.0-1_arm_cortex-a15_neon-vfpv4.ipk
Installing libcurl4 (7.78.0-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a15_neon-vfpv4/packages/libcurl4_7.78.0-1_arm_cortex-a15_neon-vfpv4.ipk
Installing libuuid1 (2.36.1-2) to root...
Downloading https://downloads.openwrt.org/releases/21.02.0/packages/arm_cortex-a15_neon-vfpv4/base/libuuid1_2.36.1-2_arm_cortex-a15_neon-vfpv4.ipk
Configuring libffi.
Configuring glib2.
Configuring libdbi.
Configuring libnghttp2-14.
Configuring libcurl4.
Configuring libuuid1.
Configuring syslog-ng.
Command failed: Not found

  1. I have a timezone issue now, part is local time other part is UTC... Example if I switch off WiFi and then back on
Sep 23 15:35:13 OpenWrt hostapd: wlan0-1: AP-STA-DISCONNECTED XX:XX:XX:XX:XX:XX
Sep 23 15:35:13 OpenWrt hostapd: wlan0-1: STA XX:XX:XX:XX:XX:XX IEEE 802.11: disassociated
Sep 23 15:35:14 OpenWrt hostapd: wlan0-1: STA XX:XX:XX:XX:XX:XX IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
Sep 23 15:35:16 OpenWrt hostapd: Beacon request: XX:XX:XX:XX:XX:XX is not connected
Sep 23 15:35:34 OpenWrt hostapd: wlan0-1: STA XX:XX:XX:XX:XX:XX IEEE 802.11: authenticated
Sep 23 15:35:34 OpenWrt hostapd: wlan0-1: STA XX:XX:XX:XX:XX:XX IEEE 802.11: associated (aid 2)
Sep 23 15:35:35 OpenWrt hostapd: wlan0-1: AP-STA-CONNECTED XX:XX:XX:XX:XX:XX
Sep 23 15:35:35 OpenWrt hostapd: wlan0-1: STA XX:XX:XX:XX:XX:XX RADIUS: starting accounting session 4C80B036936DAABB
Sep 23 15:35:35 OpenWrt hostapd: wlan0-1: STA XX:XX:XX:XX:XX:XX WPA: pairwise key handshake completed (RSN)
Sep 23 17:35:35 OpenWrt dnsmasq-dhcp[8869]: DHCPREQUEST(br-lan) 192.168.8.229 XX:XX:XX:XX:XX:XX 
Sep 23 17:35:35 OpenWrt dnsmasq-dhcp[8869]: DHCPACK(br-lan) 192.168.8.229 XX:XX:XX:XX:XX:XX XXXXXXXXXX
  1. I cannot tell why received the command failed message, the package maintainer may have answer.
  2. take step 5. :wink: syslog-ng is a complex logger with many settings and features, you can customize to your need. in the options section you may add keep_timestamp(no); and check if it makes any difference.

well it is not that important I guess.

Thank you for your help!

Ok i found the solution for the timezone issue:

destination messages {
#       file("/var/log/messages");
file("/var/log/messages" suppress(5) template("${R_YEAR}-${R_MONTH}-${R_DAY} ${R_HOUR}:${R_MIN}:${R_SEC} ${PRIORITY} ${PROGRAM}[${PID}]: ${MSGONLY}\n") log_fifo_size(256));
};

new output is also slightly more descriptive with infotype:

2021-09-24 17:15:44 notice hostapd[]: wlan0-1: AP-STA-CONNECTED xx:xx:xx:xx:xx:xx
2021-09-24 17:15:44 info hostapd[]: wlan0-1: STA cxx:xx:xx:xx:xx:xx RADIUS: starting accounting session E8410E120EC93298

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