It seems like the Package Rsyslogd from the official source lacks the module imfile.
The imfile.so module was not integrated into the rsyslogd, I would like to be able to monitor files in my unraid box or any of the docker containers and send to a remote syslog server for storage and parsing. Most standard linux like Ubuntu and CentOS come with it included by default.
logs:
input module name 'imfile' is unknown [v8.2110.0 try https://www.rsyslog.com/e/2209 ]
could not load module 'imfile', errors: trying to load module /usr/lib/rsyslog/imfile.so: Error loading shared library /usr/lib/rsyslog/imfile.so: No such file or directory [v8.2110.0 try https://www.rsyslog.com/e/2066 ]
How can I do? how to add this module into rsyslog? I tried to opkg install rsyslog-imfile, but nothing
This is not my best skillset, but I would assume it is looking for a place to build.
I'm sure someone will come in and know for sure but I read the page you provided and those instructions are for full OSs.
And the OpenWrt page Is not as informed as I'd like.
I have used this in the past (ie installing and using rsyslog on OpenWrt) and it worked just fine.
So I just installed it on a 23.05.2 system and it starts ok and the logs give: Feb 21 09:53:44 meshnode-f5a4 : [origin software="rsyslogd" swVersion="8.2110.0" x-pid="24117" x-info="https://www.rsyslog.com"] start
I does not seem to need imfile.so, it does not complain about it being missing and it still works, at least when logging remotely from other OpenWrt routers...
This will certainly not work. You will have to rebuild rsyslog yourself, and make sure its build-time config matches your requirements (so that the proper shared object for imfile support gets built).
I build openwrt by my-self, open the rsyslog-imfile flag
CONFIG_PACKAGE_rsyslog=m
# CONFIG_RSYSLOG_gssapi_krb5 is not set
# CONFIG_RSYSLOG_mysql is not set
# CONFIG_RSYSLOG_pgsql is not set
# CONFIG_RSYSLOG_libdbi is not set
# CONFIG_RSYSLOG_elasticsearch is not set
# CONFIG_RSYSLOG_omhttp is not set
# CONFIG_RSYSLOG_openssl is not set
# CONFIG_RSYSLOG_gnutls is not set
# CONFIG_RSYSLOG_mail is not set
# CONFIG_RSYSLOG_mmjsonparse is not set
# CONFIG_RSYSLOG_mmdblookup is not set
CONFIG_RSYSLOG_imfile=y