What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Customized System Log | General Log web page with filtering capabilities - WORKING PROTOTYPE

kstamand

Regular Contributor
I am aware of and familiar with Scribe, but I‘m curious if it’s possible or if anyone has already created a customization to the ”System Log | General Log” Web page that allows for filtering what displays in the log content window using grep??

Reason I ask is, when running Scribe / Uiscribe, I find the Ram usage is considerable and my goal is to see if there might be another way to filter the logs that is more efficient.
 
There is already a filter list in /www/ajax/logFilter.json that can be copied (e.g. to /jffs), modified and then run mount -o bind /jffs/logFilter.json /www/ajax/logFilter.json to take effect.
 
Thanks for the response @dave14305. Any reference anyplace on how to modify the json?
 
Thanks for the response @dave14305. Any reference anyplace on how to modify the json?
No, this isn’t really meant tobe changed by users. Just follow the existing structure, minding the commas at the end of the lines, except for the last entry in the list.
 
Making the changes as noted in post #2 of this thread worked, THANK YOU!!

Now what would be really cool would be if there was an option on the General Log Web page of the router to enter the filter strings instead of having a hardcoded file. Is that an available option anywhere?
 
To make the change persist across reboots, add to /jffs/scripts/services-start:
Bash:
#!/bin/sh

if [ -s /jffs/logFilter.json ]; then
    mount -o bind /jffs/logFilter.json /www/ajax/logFilter.json
else
    umount /www/ajax/logFilter.json 2>/dev/null
fi
Then run
Code:
chmod 755 /jffs/scripts/services-start
 
Thanks to @dave14305 I have been successfully using LogFilter.json to filter out System log messages returned on the System Log | General log WebUI.

Even with this LogFilter.json solution (appears to be exclude only), I often find myself jumping to an SSH session to grep the log to either INCLUDE or EXCLUDE specific records.

I don't know HTML and Javascript coding, but it appears that it may be possible to update /www/Main_LogStatus_Content.asp to include an INCLUDE and EXCLUDE text box to accomplish the same thing in the WebUI.

I'm not sure if this is the proper way to ask, but if this is possible, is there enough interest here in the community for something like this? If yes, any Addon developers out there willing to do this?
 
Attached is a working prototype of the solution I envisioned.
Being totally honest, I am NOT an HTML/Javascript coder, but with research + trial and error, I believe I have something that may be of interest to others.
I welcome constructive improvement suggestions/recommendations - be kind, this is my first attempt at giving back to the community.

BACKGROUND

The attached replaces the default Main_LogStatus_Content.asp with modifications that allows for a) Showing all records using the default method, b) filtering to only include log records containing specified text, or c) filtering out log records matching specified text.

1733447891934.png


INSTALL​

Here's how it to add it to your system if you are interested:

1. SSH to the router and determine where you want to save the file (I created and am using /jffs/addons/syslogUI directory)​
2. Download and save the file to this location, you will need to change the .TXT extension to a .ASP extension​
3. Enter the command mount -o bind /jffs/addons/syslogUI/Main_LogStatus_Content.asp /www/Main_LogStatus_Content.asp (this command will only be valid until the next reboot of the router.)​
4. Login to the router's WebUI, navigate to the System Log | General tab and try it out (after entering filtering text and selecting either Include Only or Exclude containing, wait up to 10 - 15 seconds and the associated log records will be displayed. I intentionally relied on the default Auto Refresh interval, figuring that's a safe place to start with the prototype)​
5. If you like it and want to make it permanent, add the above mount command to /jffs/scripts/services-start​
 

Attachments

Last edited:

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top