Question
What is wrong with my command, it is not working: grep -E (([0-9]{4})[-/]([0-9{2})[-/]([0-9]{2}))s([0][0-3])[:/]([0-9]{2})[:/]([0-9]{2})s(DROP)s(TCP)s([0-9.]*{4})s([0-9.]*{4})s([0-9]{1,})s(22) firewall.log | cut -d ' ' -f 2 | grep -E ^0[0-2]
What is wrong with my command, it is not working:
grep -E "(([0-9]{4})[-/]([0-9{2})[-/]([0-9]{2}))\s([0][0-3])[:/]([0-9]{2})[:/]([0-9]{2})\s(DROP)\s(TCP)\s([0-9.]*{4})\s([0-9.]*{4})\s([0-9]{1,})\s(22)" firewall.log | cut -d ' ' -f 2 | grep -E ^0[0-2] | wc -l
Question 4:
Write a command to count the number of events that meet this criteria;
- The event occurred between midnight and 3 AM (00:00:00 to 03:00:00)
- The dst-port is 22
- The action is DROP
- The protocol is TCP
#Version 1.5
#Software: Microsoft Windows Firewall
#Time Format: local
#Fields: date time action protocol src-ip dst-ip src-port dst-port size
2018-05-25 11:47:02 FORWARD TCP 11.100.6.64 10.202.41.103 2176 7 953880
2018-02-22 03:34:00 FORWARD UDP 11.102.7.64 10.202.40.101 2075 65 116445
2018-03-20 04:47:11 REJECT UDP 9.102.8.65 10.202.41.101 2189 97 985631
2018-11-08 14:14:47 REJECT TCP 10.101.8.64 10.202.40.103 2158 63 164259
2018-07-24 22:46:54 REJECT TCP 11.100.6.65 10.202.41.103 2089 61 991882
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started