The log file is as below:-
Source=Mobile
IP=189.23.45.01
STATUS=SUCCESS
TIME=10 sec
Source=Desktop
IP=189.23.34.23
STATUS=FAIL
TIME=101 sec
Source=Mobile
IP=189.23.34.23
STATUS=FAIL
TIME=29 sec
File keep going so on.
Questions:
- Find IP where status is FAIL?
- Find Ave time taken by all request where status is "success"?
- List how many logins were via Mobile and how much time did it took ?
grep
s context line controls. e.g.grep -B2 -A1 STATUS=FAIL
– steeling Jan 05 '19 at 17:51