Question

In: Computer Science

Instructions: Using Unix programming language and regular expressions, 1. how many unique ip addresses were seen...

Instructions:

Using Unix programming language and regular expressions,

1. how many unique ip addresses were seen note: we only want to look at ipv4 addresses
2. which was most commnly seen ip address
on the piece of access.log file below

66.249.75.132 - - [18/Jun/2018:06:41:00 -0500] "GET /~rcoleman/Common/History/Images/?C=N;O=D HTTP/1.1" 200 1976 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
5.255.250.23 - - [18/Jun/2018:06:41:23 -0500] "GET /~rcoleman/Common/CodeVault/Code/DesignPatterns/Images/DP16-Builder.jpg HTTP/1.1" 304 182 "-" "Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)"
5.255.250.23 - - [18/Jun/2018:06:41:28 -0500] "GET /~rcoleman/CS121/CourseInfo/Images/WinExp.jpg HTTP/1.1" 304 180 "-" "Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)"
148.108.96.32 - - [18/Jun/2018:06:41:43 -0500] "GET /~rcoleman/Common/Basics/Images/ASCII_Table.jpg HTTP/1.1" 200 144715 "https://www.bing.com/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0"
5.255.250.23 - - [18/Jun/2018:06:42:41 -0500] "GET /~delugach/Courses/H399-01/License%20Agreement%20for%20Acrobat HTTP/1.1" 200 12667 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)"
5.255.250.23 - - [18/Jun/2018:06:42:59 -0500] "GET /~rcoleman/Common/CodeVault/Code/DesignPatterns/Images/DP03-Decorator.jpg HTTP/1.1" 304 182 "-" "Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)"
49.36.1.71 - - [18/Jun/2018:06:43:22 -0500] "GET /favicon.ico HTTP/1.1" 301 4121 "https://www.cs.uah.edu/~rcoleman/Common/C_Reference/C++%20For%20DUMMIES.pdf" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3452.0 Safari/537.36"
148.253.182.198 - - [18/Jun/2018:06:44:00 -0500] "GET /~rcoleman/CS121/ClassTopics/Images/Operators02.jpg HTTP/1.1" 200 54617 "https://www.bing.com/" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko"
49.36.1.71 - - [18/Jun/2018:06:43:21 -0500] "GET /~rcoleman/Common/C_Reference/C++%20For%20DUMMIES.pdf HTTP/1.1" 200 8103354 "https://www.google.co.in/" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3452.0 Safari/537.36"
66.249.75.130 - - [18/Jun/2018:06:44:42 -0500] "GET /~rcoleman/Common/History/Images/Pic20_ABC.jpg HTTP/1.1" 304 181 "-" "Googlebot-Image/1.0"
179.7.54.141 - - [18/Jun/2018:06:44:53 -0500] "GET /~rcoleman/Common/C_Reference/C++%20For%20DUMMIES.pdf HTTP/1.1" 200 8085570 "-" "Dalvik/2.1.0 (Linux; U; Android 7.0; SM-J730GM Build/NRD90M)"
175.158.232.110 - - [18/Jun/2018:06:45:58 -0500] "GET /~rcoleman/CS121/ClassTopics/Images/CompSys10.jpg HTTP/1.1" 200 217846 "https://www.google.com.ph/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
5.255.250.23 - - [18/Jun/2018:06:46:03 -0500] "GET /~rcoleman/Common/SoftwareEng/Images/UML_01.jpg HTTP/1.1" 304 181 "-" "Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)"
5.255.250.23 - - [18/Jun/2018:06:46:23 -0500] "GET /~dhardin/cs_100/Animations/frmMoveBall_GUI.frm HTTP/1.1" 200 2066 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)"
216.244.66.197 - - [18/Jun/2018:06:47:14 -0500] "GET /robots.txt HTTP/1.1" 301 577 "-" "Mozilla/5.0 (compatible; DotBot/1.1; http://www.opensiteexplorer.org/dotbot, [email protected])"
157.55.39.241 - - [18/Jun/2018:06:47:37 -0500] "GET /~rcoleman/Common/Basics/Images/Pointers03.jpg HTTP/1.1" 200 76104 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
41.190.3.133 - - [18/Jun/2018:06:47:51 -0500] "GET /~rcoleman/Common/History/History.html HTTP/1.1" 200 9592 "http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=14&ved=0ahUKEwjNw_ODkt3bAhWkB8AKHfbUCMwQFghnMA0&url=http%3A%2F%2Fwww.cs.uah.edu%2F~rcoleman%2FCommon%2FHistory%2FHistory.html&usg=AOvVaw1na6HxGz_OCQSHXgI3jn1L" "Mozilla/5.0 (Windows NT 6.1; rv:36.0) Gecko/20100101 Firefox/36.0"
41.190.3.133 - - [18/Jun/2018:06:47:52 -0500] "GET /~rcoleman/Common/History/Images/Pic02_RomanAbacus.jpg HTTP/1.1" 200 43539 "http://www.cs.uah.edu/~rcoleman/Common/History/History.html" "Mozilla/5.0 (Windows NT 6.1; rv:36.0) Gecko/20100101 Firefox/36.0"
41.190.3.133 - - [18/Jun/2018:06:47:52 -0500] "GET /~rcoleman/Common/History/Images/Pic01_AncientTimes.jpg HTTP/1.1" 200 40097 "http://www.cs.uah.edu/~rcoleman/Common/History/History.html" "Mozilla/5.0 (Windows NT 6.1; rv:36.0) Gecko/20100101 Firefox/36.0"
41.190.3.133 - - [18/Jun/2018:06:47:52 -0500] "GET /~rcoleman/Common/History/Images/Pic03_JohnNapier.jpg HTTP/1.1" 200 39131 "http://www.cs.uah.edu/~rcoleman/Common/History/History.html" "Mozilla/5.0 (Windows NT 6.1; rv:36.0) Gecko/20100101 Firefox/36.0"
41.190.3.133 - - [18/Jun/2018:06:47:52 -0500] "GET /~rcoleman/Common/History/Images/Pic06_WilliamOughtred.jpg HTTP/1.1" 200 49153 "http://www.cs.uah.edu/~rcoleman/Common/History/History.html" "Mozilla/5.0 (Windows NT 6.1; rv:36.0) Gecko/20100101 Firefox/36.0"
41.190.3.133 - - [18/Jun/2018:06:47:52 -0500] "GET /~rcoleman/Common/History/Images/Pic05_SlideRule.jpg HTTP/1.1" 200 71314 "http://www.cs.uah.edu/~rcoleman/Common/History/History.html" "Mozilla/5.0 (Windows NT 6.1; rv:36.0) Gecko/20100101 Firefox/36.0"
41.190.3.133 - - [18/Jun/2018:06:47:53 -0500] "GET /~rcoleman/Common/History/Images/Pic04_NapiersBones.jpg HTTP/1.1" 200 53637 "http://www.cs.uah.edu/~rcoleman/Common/History/History.html" "Mozilla/5.0 (Windows NT 6.1; rv:36.0) Gecko/20100101 Firefox/36.0"

Solutions

Expert Solution

Answer 1
***********

grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' access.log | uniq

Answer 2
************

grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" access.log | sort | uniq -c | sort -n

if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)


Related Solutions

1. regular expressions as a mechanism to specify tokens, 2. defining context-free grammars for language constructs,...
1. regular expressions as a mechanism to specify tokens, 2. defining context-free grammars for language constructs, and 3. derivation of language terms and expressions based on a context-free grammar. 1 Regex 1. Define the regex for the following description of tokens: (a) Any string that starts with character t (b) Any string of at least length 3 that starts with t and ends with u (c) Any string that specifies the range of numbers between 11 and 23. (d) Any...
1. How is using authoring application to design a project different from using a programming language...
1. How is using authoring application to design a project different from using a programming language to build the same project? 2. What are some concerns about designing multimedia for the internet? 3. Why would you might want use lossy compression or lossless compression for an image? 4. How could you compare vectors to bitmaps?
Instructions: 1. Please use only C as the language of programming. 2. Please submit the following:...
Instructions: 1. Please use only C as the language of programming. 2. Please submit the following: (1) the client and the server source files each (2) a brief Readme le that shows the usage of the program. 3. Please appropriately comment your program and name all the identifiers suitable, to enable enhanced readability of the code. Problem: Write an ftp client and an ftp server such that the client sends a request to ftp server for downloading a file. The...
1.ARPANET originally used TCP/IP as a routing protocol for messages True False 2. Programming language developed...
1.ARPANET originally used TCP/IP as a routing protocol for messages True False 2. Programming language developed for business use and meant to run on multiple different computers. COBOL Fortran LISP BASIC 3.Transistors and vacuum tubes are no longer used in computers True False 4.The PDP series of minicomputers were developed by IBM. True False 5.Programming language popular with engineers because the code looked like algebra COBOL Fortran LISP BASIC
How to create a divide function in (Dr Racket) programming language without using the built in...
How to create a divide function in (Dr Racket) programming language without using the built in function " / " ?
CS 238 – Assembly Language Programming Fall 2019 Assignment 1 (Due: September 10, 2019) Submission Instructions:...
CS 238 – Assembly Language Programming Fall 2019 Assignment 1 (Due: September 10, 2019) Submission Instructions: Online submissions on Blackboard are preferred. Feel free to edit this Word document to insert your answers. Multiple online submissions on Blackboard are allowed, but only the last online submission made by the midnight of September 10 will be graded. Alternatively, a paper submission is possible, but it needs to be done in class on September 10. 1. Data can be interpreted as required...
Assembly Language Programming Exercise. Problem # 1: 1. Integer Expression Calculation( 5 pts ) Using the...
Assembly Language Programming Exercise. Problem # 1: 1. Integer Expression Calculation( 5 pts ) Using the AddTwo program from Section 3.2 as a reference, write a program that calculates the following expression, using registers: A = (A + B) − (C + D). Assign integer values to the EAX, EBX, ECX, and EDX registers.
Using a programming language of your choice: 1) generate a range of wavelengths, 2) compute corresponding...
Using a programming language of your choice: 1) generate a range of wavelengths, 2) compute corresponding monochromatic blackbody intensity using a) Planck function, b) Rayleigh-Jeans simplification, and c) Wien simplification, and 3) plot the three resulting spectra (i.e., a diagram that shows how B(λ) changes with λ). Using this figure explain the phenomenon of “ultraviolet catastrophe”. Please include the code (not only figure) in your answer.
Using c programming language How do you put data from a text file into a 2d...
Using c programming language How do you put data from a text file into a 2d array For example a text file with names and age: john 65 sam 34 joe 35 sarah 19 jason 18 max 14 kevin 50 pam 17 bailey 38 one 2d array should have all the names from the file and one 2d array should have all the ages and both arrays should be printed out separately and be 3x3
Write a program, using your favourite programming language, to parse time log files to report how...
Write a program, using your favourite programming language, to parse time log files to report how much time in total spent on project. The time log file TimeLogCarbon.txt. Time Log: 2/23/12: 9:10pm - 11:40pm getting familiar with Flash 2/29/12: 12:50pm - 2:00pm getting familiar with Flash 3/1/12: 6:00pm - 11:40pm getting familiar with Flash 3/3/12: 3:00pm - 7:00pm step-debug Energy Game code 3/4/12: 8:00pm - 11:40pm start carbon game 3/5/12: 2:00pm - 3:00pm, 4:00pm - 4:30pm carbon game 3/6/12: 11:30am...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT