Although not all utilities are available on the router, I suggest you review
Unix commands by Category to see for which purpose you would use
awk/
sed and
grep etc.
NOTE: Weirdly,
grep is missing in the above? but it does appear in this more comprehensive list
List ofUnix commands
So for example rather than use the script to perform the filtering you can use the Unix utilities
e.g. Use
'grep' to filter out any Web History records that contain the string
'google', and use the
'head' utility to only print the first
10 matching results:
Code:
./WebHistory_Report.sh nofilter noscript | grep google | head -n 10
(WebHistory_Report.sh): 14364 v1.14 Web History starting.....
2019-01-31 13:43:11|1548942191|58:C5:CB:05:5A:4B|android.clients.google.com
2019-01-31 16:44:49|1548953089|58:C5:CB:05:5A:4B|inbox.google.com
2019-01-31 16:31:37|1548952297|58:C5:CB:05:5A:4B|www.google.com
2019-01-31 16:43:07|1548952987|58:C5:CB:05:5A:4B|www.googleapis.com
2019-01-31 16:45:41|1548953141|58:C5:CB:05:5A:4B|clients4.google.com
2019-01-31 16:44:48|1548953088|58:C5:CB:05:5A:4B|play.googleapis.com
2019-08-07 08:27:20|1565166440|54:60:09:0A:17:F4|tools.google.com
2019-01-31 16:37:39|1548952659|58:C5:CB:05:5A:4B|safebrowsing.googleapis.com
2019-06-21 22:48:29|1561157309|48:45:20:D7:A6:22|clientservices.googleapis.com
2019-06-21 22:48:29|1561157309|48:45:20:D7:A6:22|accounts.google.com
This example adds an additional filter to the above matching records and eliminates any
'google' records that contain
'android'
Code:
./WebHistory_Report.sh nofilter noscript | grep google | grep -v android | head -n 10
(WebHistory_Report.sh): 25585 v1.14 Web History starting.....
2019-01-31 16:44:49|1548953089|58:C5:CB:05:5A:4B|inbox.google.com
2019-01-31 16:31:37|1548952297|58:C5:CB:05:5A:4B|www.google.com
2019-01-31 16:43:07|1548952987|58:C5:CB:05:5A:4B|www.googleapis.com
2019-01-31 16:45:41|1548953141|58:C5:CB:05:5A:4B|clients4.google.com
2019-01-31 16:44:48|1548953088|58:C5:CB:05:5A:4B|play.googleapis.com
2019-08-07 08:27:20|1565166440|54:60:09:0A:17:F4|tools.google.com
2019-01-31 16:37:39|1548952659|58:C5:CB:05:5A:4B|safebrowsing.googleapis.com
2019-06-21 22:48:29|1561157309|48:45:20:D7:A6:22|clientservices.googleapis.com
2019-06-21 22:48:29|1561157309|48:45:20:D7:A6:22|accounts.google.com
2019-06-22 07:31:55|1561188715|48:45:20:D7:A6:22|www.googleapis.com
This example adds a further filter that eliminates any of the above matching records that occurred on the 31st day of any month in 2019:
Code:
./WebHistory_Report.sh nofilter noscript | grep google | grep -v android | grep -vE "2019-..-31" | head -n 10
(WebHistory_Report.sh): 22111 v1.14 Web History starting.....
2019-08-07 08:27:20|1565166440|54:60:09:0A:17:F4|tools.google.com
2019-06-21 22:48:29|1561157309|48:45:20:D7:A6:22|clientservices.googleapis.com
2019-06-21 22:48:29|1561157309|48:45:20:D7:A6:22|accounts.google.com
2019-06-22 07:31:55|1561188715|48:45:20:D7:A6:22|www.googleapis.com
2019-06-19 09:36:24|1560936984|48:45:20:D7:A6:22|www.google.co.uk
2019-06-21 22:48:39|1561157319|48:45:20:D7:A6:22|clients2.google.com
2019-06-21 23:04:34|1561158274|48:45:20:D7:A6:22|safebrowsing.googleapis.com
2019-06-22 07:32:30|1561188750|48:45:20:D7:A6:22|update.googleapis.com
2019-05-10 08:52:03|1557478323|48:45:20:D7:A6:22|storage.googleapis.com
2019-06-22 07:52:53|1561189973|48:45:20:D7:A6:22|pagead2.googlesyndication.com
Hopfully you can see that the use of the utilities (in this case
'grep') can provide very complex filtering.